Problem
In stacks-wallet-provider.tsx, the connect catch block calls:
getSelectedProvider()?.disconnect?.();
But the OKX code path never calls setSelectedProviderId() before the await getOKXStacksAddress() call. If there was a previously connected provider, the catch block will disconnect that provider instead of OKX.
Fix
Either:
- Call
setSelectedProviderId for OKX before the await
- Or skip the
getSelectedProvider()?.disconnect?.() call when the failed provider is OKX
Context
Identified during code review of PR #2.
Problem
In
stacks-wallet-provider.tsx, theconnectcatch block calls:But the OKX code path never calls
setSelectedProviderId()before theawait getOKXStacksAddress()call. If there was a previously connected provider, the catch block will disconnect that provider instead of OKX.Fix
Either:
setSelectedProviderIdfor OKX before the awaitgetSelectedProvider()?.disconnect?.()call when the failed provider is OKXContext
Identified during code review of PR #2.