Skip to content

OKX connect failure disconnects wrong provider #6

@satoshai-dev

Description

@satoshai-dev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions