Skip to content

Commit

Permalink
Merge pull request #82 from deriv-com/shayan/FEWP-262/add-accountsLis…
Browse files Browse the repository at this point in the history
…t-fallback

chore: added fallback to accountList inside auth-context
  • Loading branch information
shayan-deriv authored Sep 30, 2024
2 parents c042a07 + 8753e7c commit dac497b
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 dac497b

Please sign in to comment.