Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aizad/WALL-1987/Seeing loading issue during DIEL account creation #10391

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/hooks/src/useAuthorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const useAuthorize = (token?: string) => {
const { accounts, loginid = '' } = client;
const current_token = accounts[loginid || '']?.token;

const { data, ...rest } = useFetch('authorize', { payload: { authorize: token ?? current_token } });
const { data, ...rest } = useFetch('authorize', {
payload: { authorize: token ?? current_token },
options: { enabled: Boolean(token ?? current_token) },
});

// Add additional information to the authorize response.
const modified_authorize = useMemo(() => ({ ...data?.authorize }), [data?.authorize]);
Expand Down
6 changes: 3 additions & 3 deletions packages/hooks/src/useWalletsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ const currency_to_icon_mapper: Record<string, Record<'light' | 'dark', string>>
/** A custom hook to get the list of wallets for the current user. */
const useWalletsList = () => {
const { client, ui } = useStore();
const { loginid, is_authorize } = client;
const { loginid } = client;
aizad-deriv marked this conversation as resolved.
Show resolved Hide resolved
const { is_dark_mode_on } = ui;
const { getConfig } = useCurrencyConfig();

const { data: authorize_data, ...rest } = useAuthorize();
const { data: authorize_data, isSuccess, ...rest } = useAuthorize();
const { data: balance_data } = useFetch('balance', {
payload: { account: 'all' },
options: { enabled: is_authorize },
options: { enabled: isSuccess },
});

// Filter out non-wallet accounts.
Expand Down