Skip to content

Commit

Permalink
configuartion of syncCtx check (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoysheO authored Sep 27, 2024
1 parent 0d2fc3c commit 10247ab
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public async Task<IWalletConnect> InitializeAsync()
}

var currentSyncContext = SynchronizationContext.Current;
if (currentSyncContext.GetType().FullName != "UnityEngine.UnitySynchronizationContext")
bool isSkipSyncCtxCheck = AppContext.TryGetSwitch("IsSkipWalletConnectSyncCtxCheck", out var isEnabled) && isEnabled;
if (!isSkipSyncCtxCheck && currentSyncContext.GetType().FullName != "UnityEngine.UnitySynchronizationContext")
throw new Exception(
$"[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."
);
Expand Down

0 comments on commit 10247ab

Please sign in to comment.