Skip to content

Commit

Permalink
index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
intls committed Feb 4, 2025
1 parent 19f3e29 commit 0d74521
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/web3-react-agw/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ export class AbstractGlobalWallet extends Connector {
this.actions.resetState();
this.onError?.(error);
});

this.provider.on('disconnect', (error: ProviderRpcError): void => {
this.actions.resetState();
this.onError?.(error);
});


this.provider.on('chainChanged', (chainId: string): void => {
this.actions.update({ chainId: parseChainId(chainId) });
});
Expand Down Expand Up @@ -148,7 +143,7 @@ export class AbstractGlobalWallet extends Connector {
method: 'wallet_switchEthereumChain',
params: [{ chainId: desiredChainIdHex }],
});
this.activate(desiredChainId);
await this.activate(desiredChainId);
} else {
throw new Error('Invalid chain');
}
Expand Down

0 comments on commit 0d74521

Please sign in to comment.