Skip to content

Commit

Permalink
fix: retry account when invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgeron committed Oct 14, 2024
1 parent 9ebe044 commit 54d7f94
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/react/src/hooks/useAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,11 @@ export const useAccount = (
return useNamedQuery('account', {
queryKey: QUERY_KEYS.account(fuel.name),
queryFn: async () => {
try {
const currentFuelAccount = await fuel?.currentAccount();
return currentFuelAccount;
} catch (_error: unknown) {
return null;
}
return await fuel?.currentAccount();
},
placeholderData: null,
retry: 5,
retryDelay: 100,
...params?.query,
});
};

0 comments on commit 54d7f94

Please sign in to comment.