File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Assets/Thirdweb/Core/Scripts Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,15 @@ public Wallet()
2929 /// <returns>A task representing the connection result.</returns>
3030 public async Task < string > Connect ( WalletConnection walletConnection )
3131 {
32+ string address = null ;
33+
3234 if ( Utils . IsWebGLBuild ( ) )
3335 {
34- return await Bridge . Connect ( walletConnection ) ;
36+ address = await Bridge . Connect ( walletConnection ) ;
3537 }
3638 else
3739 {
38- string address = await ThirdwebManager . Instance . SDK . session . Connect ( walletConnection ) ;
40+ address = await ThirdwebManager . Instance . SDK . session . Connect ( walletConnection ) ;
3941 Utils . TrackWalletAnalytics (
4042 ThirdwebManager . Instance . SDK . session . Options . clientId ,
4143 "connectWallet" ,
@@ -45,6 +47,17 @@ public async Task<string> Connect(WalletConnection walletConnection)
4547 ) ;
4648 return address ;
4749 }
50+
51+ try
52+ {
53+ await SwitchNetwork ( walletConnection . chainId ) ;
54+ }
55+ catch
56+ {
57+ // no-op
58+ }
59+
60+ return address ;
4861 }
4962
5063 /// <summary>
You can’t perform that action at this time.
0 commit comments