mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-19 01:03:57 +00:00
feat: add event and check if user is logged in
This commit is contained in:
@@ -86,9 +86,12 @@ export function App() {
|
||||
dispatch(setProfileBackground(profileBackground));
|
||||
}
|
||||
|
||||
/* TODO: Check if user is logged in before calling this */
|
||||
fetchUserDetails().then((response) => {
|
||||
if (response) setUserDetails(response);
|
||||
window.electron.isUserLoggedIn().then((isLoggedIn) => {
|
||||
if (isLoggedIn) {
|
||||
fetchUserDetails().then((response) => {
|
||||
if (response) setUserDetails(response);
|
||||
});
|
||||
}
|
||||
});
|
||||
}, [dispatch, fetchUserDetails]);
|
||||
|
||||
|
||||
1
src/renderer/src/declaration.d.ts
vendored
1
src/renderer/src/declaration.d.ts
vendored
@@ -96,6 +96,7 @@ declare global {
|
||||
|
||||
/* Misc */
|
||||
openExternal: (src: string) => Promise<void>;
|
||||
isUserLoggedIn: () => Promise<boolean>;
|
||||
getVersion: () => Promise<string>;
|
||||
ping: () => string;
|
||||
getDefaultDownloadsPath: () => Promise<string>;
|
||||
|
||||
Reference in New Issue
Block a user