Skip to content

Commit

Permalink
Fix walletconnect switch chain
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbqds committed Dec 19, 2023
1 parent cb32005 commit 668683b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bridge_ui/src/hooks/useIsWalletReady.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ function useIsWalletReady(
return;
}

// `wallet_switchEthereumChain` does not work if connected to
// metamask-mobile via walletconnect:
// https://github.com/MetaMask/metamask-mobile/issues/6655
// https://github.com/MetaMask/metamask-mobile/issues/7023
if (connectType === ConnectType.WALLETCONNECT) {
disconnect()
return;
}

try {
await provider.send("wallet_switchEthereumChain", [
{ chainId: hexStripZeros(hexlify(correctEvmNetwork)) },
Expand Down

0 comments on commit 668683b

Please sign in to comment.