Skip to content

Commit

Permalink
show wallet error alert if can't load wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
benisgold committed Dec 9, 2024
1 parent 0a1b9c1 commit 06f2093
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { getDefaultSlippageWorklet } from '@/__swaps__/utils/swaps';
import { getRemoteConfig } from '@/model/remoteConfig';
import { estimateClaimUnlockSwapGasLimit } from '../estimateGas';
import { chainsNativeAsset } from '@/chains';
import showWalletErrorAlert from '@/helpers/support';

enum ErrorMessages {
SWAP_ERROR = 'Failed to swap claimed asset due to swap action error',
Expand Down Expand Up @@ -346,11 +347,15 @@ export function TransactionClaimableContextProvider({
return;
}

const wallet = await loadWallet({
address: accountAddress,
showErrorIfNotLoaded: false,
provider,
});
let wallet;
try {
wallet = await loadWallet({
address: accountAddress,
provider,
});
} catch {
showWalletErrorAlert();
}

if (!wallet) {
// Biometrics auth failure (retry possible)
Expand Down

0 comments on commit 06f2093

Please sign in to comment.