File tree Expand file tree Collapse file tree
widgets-lib/src/widgets/connect/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,6 +165,13 @@ export async function switchWalletNetwork(
165165 ) ;
166166 }
167167
168+ // walletconnect on trying to switch network, if network doesn't exist, it does not throw an error!
169+ // so the catch block below is not triggered, so we need to add the network manually
170+ // always calling addNetworkToWallet is harmless, as nothing happens if the network already exists
171+ if ( provider . ethereumProvider ?. isWalletConnect ) {
172+ await addNetworkToWallet ( networkMap , provider , chainId ) ;
173+ }
174+
168175 // WT-1146 - Refer to the README in this folder for explanation on the switch network flow
169176 try {
170177 await switchNetworkInWallet ( networkMap , provider , chainId ) ;
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ export function WalletList(props: WalletListProps) {
215215
216216 const connectCallback = async ( ethereumProvider : EthereumProvider ) => {
217217 if ( ethereumProvider . connected && ethereumProvider . session ) {
218- const browserProvider = new WrappedBrowserProvider ( ethereumProvider , 'any' ) ;
218+ const browserProvider = new WrappedBrowserProvider ( ethereumProvider ) ;
219219 selectBrowserProvider ( browserProvider , 'walletconnect' ) ;
220220
221221 if ( ethereumProvider . chainId !== targetChainId ) {
You can’t perform that action at this time.
0 commit comments