Skip to content

Commit

Permalink
fix: ternary option for token
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahdiyeh Amirkhani authored and Mahdiyeh Amirkhani committed Aug 2, 2023
1 parent 4cd56ac commit 29577a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hooks/src/useAuthorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useStore } from '@deriv/stores';
const useAuthorize = (token?: string) => {
const { client } = useStore();
const { accounts, loginid = '' } = client;
const current_token = accounts[loginid || ''].token;
const current_token = accounts[loginid || '']?.token;

const { data, ...rest } = useFetch('authorize', { payload: { authorize: token || current_token } });

Expand Down

0 comments on commit 29577a7

Please sign in to comment.