Skip to content

Commit 10247ab

Browse files
authored
configuartion of syncCtx check (#216)
1 parent 0d2fc3c commit 10247ab

File tree

1 file changed

+2
-1
lines changed
  • Assets/Thirdweb/Plugins/WalletConnectUnity/com.walletconnect.core/Runtime

1 file changed

+2
-1
lines changed

Assets/Thirdweb/Plugins/WalletConnectUnity/com.walletconnect.core/Runtime/WalletConnect.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public async Task<IWalletConnect> InitializeAsync()
6969
}
7070

7171
var currentSyncContext = SynchronizationContext.Current;
72-
if (currentSyncContext.GetType().FullName != "UnityEngine.UnitySynchronizationContext")
72+
bool isSkipSyncCtxCheck = AppContext.TryGetSwitch("IsSkipWalletConnectSyncCtxCheck", out var isEnabled) && isEnabled;
73+
if (!isSkipSyncCtxCheck && currentSyncContext.GetType().FullName != "UnityEngine.UnitySynchronizationContext")
7374
throw new Exception(
7475
$"[WalletConnectUnity] SynchronizationContext is not of type UnityEngine.UnitySynchronizationContext. Current type is <i>{currentSyncContext.GetType().FullName}</i>. Make sure to initialize WalletConnect from the main thread."
7576
);

0 commit comments

Comments
 (0)