Skip to content

Commit

Permalink
fix offline crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbuedo committed Sep 30, 2024
1 parent 6aad749 commit 4580948
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 50 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
96 changes: 48 additions & 48 deletions apps/wallet-mobile/translations/messages/src/WalletNavigator.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,179 +4,179 @@
"defaultMessage": "!!!Transactions",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 301,
"line": 305,
"column": 22,
"index": 10506
"index": 10584
},
"end": {
"line": 304,
"line": 308,
"column": 3,
"index": 10609
"index": 10687
}
},
{
"id": "components.txhistory.txnavigationbuttons.sendButton",
"defaultMessage": "!!!Send",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 305,
"line": 309,
"column": 14,
"index": 10625
"index": 10703
},
"end": {
"line": 308,
"line": 312,
"column": 3,
"index": 10724
"index": 10802
}
},
{
"id": "components.txhistory.txnavigationbuttons.receiveButton",
"defaultMessage": "!!!Receive",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 309,
"line": 313,
"column": 17,
"index": 10743
"index": 10821
},
"end": {
"line": 312,
"line": 316,
"column": 3,
"index": 10848
"index": 10926
}
},
{
"id": "components.common.navigation.dashboardButton",
"defaultMessage": "!!!Dashboard",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 313,
"line": 317,
"column": 19,
"index": 10869
"index": 10947
},
"end": {
"line": 316,
"line": 320,
"column": 3,
"index": 10966
"index": 11044
}
},
{
"id": "components.common.navigation.delegateButton",
"defaultMessage": "!!!Delegate",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 317,
"line": 321,
"column": 18,
"index": 10986
"index": 11064
},
"end": {
"line": 320,
"line": 324,
"column": 3,
"index": 11081
"index": 11159
}
},
{
"id": "components.settings.walletsettingscreen.tabTitle",
"defaultMessage": "!!!Wallet",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 321,
"line": 325,
"column": 16,
"index": 11099
"index": 11177
},
"end": {
"line": 324,
"line": 328,
"column": 3,
"index": 11197
"index": 11275
}
},
{
"id": "global.staking",
"defaultMessage": "!!!Staking",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 325,
"line": 329,
"column": 17,
"index": 11216
"index": 11294
},
"end": {
"line": 328,
"line": 332,
"column": 3,
"index": 11281
"index": 11359
}
},
{
"id": "components.common.navigation.nftGallery",
"defaultMessage": "!!!NFT Gallery",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 329,
"line": 333,
"column": 14,
"index": 11297
"index": 11375
},
"end": {
"line": 332,
"line": 336,
"column": 3,
"index": 11391
"index": 11469
}
},
{
"id": "menu",
"defaultMessage": "!!!Menu",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 333,
"line": 337,
"column": 14,
"index": 11407
"index": 11485
},
"end": {
"line": 336,
"line": 340,
"column": 3,
"index": 11459
"index": 11537
}
},
{
"id": "components.common.navigation.discover",
"defaultMessage": "!!!Discover",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 337,
"line": 341,
"column": 18,
"index": 11479
"index": 11557
},
"end": {
"line": 340,
"line": 344,
"column": 3,
"index": 11568
"index": 11646
}
},
{
"id": "components.walletselection.walletselectionscreen.header",
"defaultMessage": "!!!My wallets",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 341,
"line": 345,
"column": 31,
"index": 11601
"index": 11679
},
"end": {
"line": 344,
"line": 348,
"column": 3,
"index": 11710
"index": 11788
}
},
{
"id": "global.portfolio",
"defaultMessage": "!!!Portfolio",
"file": "src/WalletNavigator.tsx",
"start": {
"line": 345,
"line": 349,
"column": 19,
"index": 11731
"index": 11809
},
"end": {
"line": 348,
"line": 352,
"column": 3,
"index": 11800
"index": 11878
}
}
]

0 comments on commit 4580948

Please sign in to comment.