Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Oct 16, 2023
1 parent 3a34aa0 commit 2df90c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yearn-finance/web-lib",
"version": "3.0.53",
"version": "3.0.54",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
"files": [
Expand Down
12 changes: 11 additions & 1 deletion src/utils/wagmi/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ export async function handleTx<
** First, make sure we are using the correct chainID.
******************************************************************************************/
if (wagmiProvider.chainId !== args.chainID) {
await switchNetwork({chainId: args.chainID});
try {
await switchNetwork({chainId: args.chainID});
} catch (error) {
if (!(error instanceof BaseError)) {
return ({isSuccessful: false, error});
}
toast.error(error.shortMessage);
args.statusHandler?.({...defaultTxStatus, error: true});
console.error(error);
return ({isSuccessful: false, error});
}
}

wagmiProvider = await toWagmiProvider(args.connector);
Expand Down

0 comments on commit 2df90c2

Please sign in to comment.