[bug]Cannot reconnect Metamask after disconnecting
theawkwardchild opened this issue · comments
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
- Open any of the rainbowkit examples (tested each of the CodeSandbox examples as well as running the project on my own computer)
- Connect with Metamask on desktop using the browser extension
- Click on your wallet profile and disconnect
- Again click the Connect Wallet button and select Metamask
- See how it hangs and does not open the Metamask extension to prompt you to connect
- Exit the Metamask connection and connect a different wallet using WalletConnect
- Disconnect from your current WalletConnect session
- See how it instantly reopens your previously disconnected Metamask wallet session
- 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
Disconnect
Trying and failing to reconnect using Metamask
@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 ?
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.
@theawkwardchild Mhmm this is weird. Let me know if you still get stuck on this otherwise feel free to re-open this issue 👍