File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " bnc-onboard" ,
3
- "version" : " 1.32.0-0.2.1 " ,
3
+ "version" : " 1.32.0-0.2.2 " ,
4
4
"description" : " Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state." ,
5
5
"keywords" : [
6
6
" ethereum" ,
Original file line number Diff line number Diff line change 1
- import { networkName } from '../../utilities'
1
+ import { getProviderName , networkName } from '../../utilities'
2
2
import {
3
3
WalletCheckModal ,
4
4
StateAndHelpers ,
@@ -41,14 +41,18 @@ function network(
41
41
} )
42
42
}
43
43
}
44
- try {
45
- await wallet ?. provider ?. request ( {
46
- method : 'wallet_switchEthereumChain' ,
47
- params : [ { chainId : '0x' + appNetworkId ?. toString ( 16 ) } ]
48
- } )
49
- } catch ( e ) {
50
- // Could not switch networks so proceed as normal through the checks
44
+ // Adds a check for WalletConnect since it hangs for unsupported rpc methods
45
+ if ( getProviderName ( wallet ?. provider ) !== 'WalletConnect' ) {
46
+ try {
47
+ await wallet ?. provider ?. request ( {
48
+ method : 'wallet_switchEthereumChain' ,
49
+ params : [ { chainId : '0x' + appNetworkId ?. toString ( 16 ) } ]
50
+ } )
51
+ } catch ( e ) {
52
+ // Could not switch networks so proceed as normal through the checks
53
+ }
51
54
}
55
+
52
56
if ( stateStore . network . get ( ) != appNetworkId ) {
53
57
return {
54
58
heading : heading || 'You Must Change Networks' ,
You can’t perform that action at this time.
0 commit comments