Merge branch 'main' of github.com:hydralauncher/hydra into fix/adding-sorting-to-repacks-modal

This commit is contained in:
Chubby Granny Chaser 2024-07-04 18:36:15 +01:00
commit d8158bb80e
No known key found for this signature in database
47 changed files with 584 additions and 464 deletions

View file

@ -93,12 +93,8 @@ export function App() {
dispatch(setProfileBackground(profileBackground));
}
window.electron.isUserLoggedIn().then((isLoggedIn) => {
if (isLoggedIn) {
fetchUserDetails().then((response) => {
if (response) updateUserDetails(response);
});
}
fetchUserDetails().then((response) => {
if (response) updateUserDetails(response);
});
}, [fetchUserDetails, updateUserDetails, dispatch]);

View file

@ -100,7 +100,6 @@ declare global {
/* Misc */
openExternal: (src: string) => Promise<void>;
isUserLoggedIn: () => Promise<boolean>;
getVersion: () => Promise<string>;
ping: () => string;
getDefaultDownloadsPath: () => Promise<string>;

View file

@ -57,8 +57,14 @@ export function useUserDetails() {
);
const fetchUserDetails = useCallback(async () => {
return window.electron.getMe();
}, []);
return window.electron.getMe().then((userDetails) => {
if (userDetails == null) {
clearUserDetails();
}
return userDetails;
});
}, [clearUserDetails]);
const patchUser = useCallback(
async (displayName: string, imageProfileUrl: string | null) => {

View file

@ -122,7 +122,7 @@ export function HeroPanelActions() {
<Button
onClick={() => setShowGameOptionsModal(true)}
theme="outline"
disabled={deleting || isGameRunning}
disabled={deleting}
className={styles.heroPanelAction}
>
<GearIcon />