Skip to content

Commit

Permalink
fix(wallet-mobile): offline crashes (#3664)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbuedo authored Oct 15, 2024
1 parent 0432939 commit ea153f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ export const useBestBlock = ({options}: {options?: UseQueryOptions<Chain.Cardano
retry: 3,
retryDelay: 1_000,
queryKey: [network, 'tipStatus'],
queryFn: () => networkManager.api.bestBlock(),
queryFn: () =>
networkManager.api.bestBlock().catch(() => ({
// TODO: Without this it break when offline. Needs better fixing
epoch: 510,
slot: 130081,
globalSlot: 135086881,
hash: 'ab0093eb78bcb0146355741388632eb50c69407df8fa32de85e5f198d725e8f4',
height: 10850697,
})),
...options,
})

Expand Down
5 changes: 4 additions & 1 deletion apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,10 @@ export const useFrontendFees = (
suspense: true,
queryKey: [wallet.id, 'frontend-fees'],
...options,
queryFn: () => wallet.api.getFrontendFees(),
queryFn: () =>
wallet.api.getFrontendFees().catch(() => ({
// TODO: Without this it break when offline. Needs better fixing
})),
})

return {
Expand Down

0 comments on commit ea153f9

Please sign in to comment.