diff --git a/src/hooks/useProfile.ts b/src/hooks/useProfile.ts index 3fda753b3..ef8b986cc 100644 --- a/src/hooks/useProfile.ts +++ b/src/hooks/useProfile.ts @@ -1,6 +1,6 @@ import { useEffect } from 'react' import { Profile } from '../utils/auth/types' -import identify, { restoreCurrentProfile, setCurrentProfile, createProfileEffect } from "../utils/auth/identify" +import identify, { restoreCurrentProfile, setCurrentProfile, createProfileEffect, getCurrentProfile } from "../utils/auth/identify" import usePatchState from './usePatchState' let CURRENT_PROFILE_LOADER: Promise | null = null @@ -52,7 +52,7 @@ export default function useProfile() { } useEffect(() => { - patchState({ loading: false, profile: restoreCurrentProfile() }) + patchState({ loading: false, profile: getCurrentProfile() || restoreCurrentProfile() }) return createProfileEffect((event) => patchState({ profile: event.newProfile })) }, [])