Skip to content

Commit

Permalink
chore: added fallback to accountList inside auth-context
Browse files Browse the repository at this point in the history
  • Loading branch information
shayan-deriv committed Sep 30, 2024
1 parent c042a07 commit 8753e7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/context/auth-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const AuthDataProvider = ({ children }: AuthDataProviderProps) => {

const { mutateAsync: requestLogout } = useLogout();

const accountsList: Record<string, string> = JSON.parse(localStorage.getItem('client.accounts') ?? '{}');
const accountsList: Record<string, string> = JSON.parse(
localStorage.getItem('client.accounts') ?? localStorage.getItem('accountsList') ?? '{}'
);

const isAuthorized = useMemo(
() => isSuccess && (!!activeLoginid || !!Object.keys(accountsList).length),
Expand Down

0 comments on commit 8753e7c

Please sign in to comment.