Skip to content

Commit 7222b6a

Browse files
committed
Fix reconnection case where sw eoa fails to connect
1 parent 9e4ebba commit 7222b6a

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

Assets/Thirdweb/Core/Scripts/ThirdwebSession.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,23 @@ internal async Task<string> Connect(WalletConnection walletConnection)
6767
throw new UnityException("Smart wallet config is required for smart wallet connection method!");
6868
if (ActiveWallet?.GetProvider() != walletConnection.personalWallet)
6969
{
70-
await Connect(
71-
new WalletConnection(
72-
provider: walletConnection.personalWallet,
73-
chainId: walletConnection.chainId,
74-
password: walletConnection.password,
75-
email: walletConnection.email,
76-
authOptions: walletConnection.authOptions
77-
)
78-
);
70+
try
71+
{
72+
await Connect(
73+
new WalletConnection(
74+
provider: walletConnection.personalWallet,
75+
chainId: walletConnection.chainId,
76+
password: walletConnection.password,
77+
email: walletConnection.email,
78+
authOptions: walletConnection.authOptions
79+
)
80+
);
81+
}
82+
catch
83+
{
84+
ActiveWallet = null;
85+
throw;
86+
}
7987
}
8088
else
8189
{

0 commit comments

Comments
 (0)