Merge branch 'feature/user-profile' of github.com:hydralauncher/hydra into feature/user-profile

This commit is contained in:
Chubby Granny Chaser 2024-06-17 23:05:00 +01:00
commit b3e2346808
No known key found for this signature in database
4 changed files with 7 additions and 7 deletions

View file

@ -112,7 +112,7 @@ declare global {
restartAndInstallUpdate: () => Promise<void>;
/* Authg */
signout: () => Promise<void>;
signOut: () => Promise<void>;
onSignIn: (cb: () => void) => () => Electron.IpcRenderer;
onSignOut: (cb: () => void) => () => Electron.IpcRenderer;

View file

@ -5,13 +5,13 @@ import { setUserAuth } from "@renderer/features";
export function useUserAuth() {
const dispatch = useAppDispatch();
const [isLoading, setIsLoading] = useState(false);
const [isLoading, setIsLoading] = useState(true);
const { userAuth } = useAppSelector((state) => state.userAuth);
const signOut = useCallback(async () => {
dispatch(setUserAuth(null));
return window.electron.signout();
return window.electron.signOut();
}, [dispatch]);
const updateUserAuth = useCallback(async () => {
@ -27,7 +27,7 @@ export function useUserAuth() {
useEffect(() => {
updateUserAuth();
}, []);
}, [updateUserAuth]);
const clearUserAuth = useCallback(async () => {
dispatch(setUserAuth(null));