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]Cannot reconnect Metamask after disconnecting #2022

Closed
1 task done
theawkwardchild opened this issue Jun 3, 2024 · 3 comments
Closed
1 task done

[bug]Cannot reconnect Metamask after disconnecting #2022

theawkwardchild opened this issue Jun 3, 2024 · 3 comments

Comments

@theawkwardchild
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

RainbowKit Version

2.1.2

wagmi Version

2.9.8

Current Behavior

After connecting and then disconnecting using Metamask, you are not able to reconnect with Metamask until the page is refreshed. Additionally, if you first connect using Metamask, then disconnect, then connect using another option such as Walletconnect, and then disconnect, you will be reconnected to your original Metamask wallet. The wagmi.store found in the Local Storage is also not being reset when disconnecting from Metamask.

Expected Behavior

The expected behavior is that after disconnecting from your Metamask wallet, you should be able to reconnect again to Metamask without having to reload the page. It also should not reconnect your Metamask session after disconnecting from another provider.

Steps To Reproduce

  1. Open any of the rainbowkit examples (tested each of the CodeSandbox examples as well as running the project on my own computer)
  2. Connect with Metamask on desktop using the browser extension
  3. Click on your wallet profile and disconnect
  4. Again click the Connect Wallet button and select Metamask
  5. See how it hangs and does not open the Metamask extension to prompt you to connect
  6. Exit the Metamask connection and connect a different wallet using WalletConnect
  7. Disconnect from your current WalletConnect session
  8. See how it instantly reopens your previously disconnected Metamask wallet session
  9. Refreshing the page you will briefly see a quick flash of your previously connected wallet, only then will you be able to reconnect using Metamask

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

https://codesandbox.io/p/sandbox/github/rainbow-me/rainbowkit/tree/main/examples/with-vite

Anything else?

Connect using Metamask
image
Disconnect
image
Trying and failing to reconnect using Metamask
image

@magiziz
Copy link
Contributor

magiziz commented Jun 3, 2024

@theawkwardchild This is weird. I'm able to connect with metamask while disconnecting and connecting again. Can you try doing this in a different browser or try close and reopen your browser ? Also are you able to reproduce this issue in our example dApp here https://rainbowkit-example.vercel.app ?

image

@theawkwardchild
Copy link
Author

Hey @magiziz thanks for checking that out. You might be able to close this as just a problem on my end. I had tried on both chrome and firefox and was seeing the issue, but then a friend had no issues himself.

@magiziz
Copy link
Contributor

magiziz commented Jun 3, 2024

@theawkwardchild Mhmm this is weird. Let me know if you still get stuck on this otherwise feel free to re-open this issue 👍

@magiziz magiziz closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants