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()
29
29
/// <returns>A task representing the connection result.</returns>
30
30
public async Task < string > Connect ( WalletConnection walletConnection )
31
31
{
32
+ string address = null ;
33
+
32
34
if ( Utils . IsWebGLBuild ( ) )
33
35
{
34
- return await Bridge . Connect ( walletConnection ) ;
36
+ address = await Bridge . Connect ( walletConnection ) ;
35
37
}
36
38
else
37
39
{
38
- string address = await ThirdwebManager . Instance . SDK . session . Connect ( walletConnection ) ;
40
+ address = await ThirdwebManager . Instance . SDK . session . Connect ( walletConnection ) ;
39
41
Utils . TrackWalletAnalytics (
40
42
ThirdwebManager . Instance . SDK . session . Options . clientId ,
41
43
"connectWallet" ,
@@ -45,6 +47,17 @@ public async Task<string> Connect(WalletConnection walletConnection)
45
47
) ;
46
48
return address ;
47
49
}
50
+
51
+ try
52
+ {
53
+ await SwitchNetwork ( walletConnection . chainId ) ;
54
+ }
55
+ catch
56
+ {
57
+ // no-op
58
+ }
59
+
60
+ return address ;
48
61
}
49
62
50
63
/// <summary>
You can’t perform that action at this time.
0 commit comments