Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Event when user disconnects all wallets #2147

Open
titusdecali opened this issue Apr 11, 2024 · 2 comments
Open

[BUG]: Event when user disconnects all wallets #2147

titusdecali opened this issue Apr 11, 2024 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@titusdecali
Copy link

Is your request related to a problem?

I have a complex flow using multiple wallet connectors, and thus am managing connected wallets internally and not only via Onboard. If the user uses the Onboard disconnect all wallets button, I would like to catch an event and wipe those wallets from my internal state as well (since they are no longer available), however I see nothing in the docs which provides this.

I've also tried adding a watcher to the connectedWallet value to see if it is updated when all wallets are disconnected, but it doesn't appear to update.

Am I missing something in the docs, or can you add this minor feature?

Thanks

Feature Description

No response

Alternative Solutions

No response

Anything else?

No response

@titusdecali titusdecali added the feature New feature or request label Apr 11, 2024
@Adamj1232
Copy link
Member

@titusdecali thanks for opening this PR - there does seem to be an issue with connectedWallets. It may take some tim,e for this to work its way into our back log so for the time being you can get the proper events directly from the wallets state through the API as shown here

  // Subscribe to wallet updates
  const wallets$ = onboard.state.select('wallets').pipe(share())
  wallets$.subscribe(wallet => {
    console.log(wallet)
  })

@Adamj1232 Adamj1232 changed the title [Feature]: Event when user disconnects all wallets [BUG]: Event when user disconnects all wallets Apr 11, 2024
@titusdecali
Copy link
Author

titusdecali commented Apr 12, 2024

@Adamj1232 That worked a treat! Thanks for your support ^^
I'll leave this issue open for you to close when the wallets are updating as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants