[bug] Website auto-connecting to MM extension wallet even after disconnecting
Is there an existing issue for this?
- [X] I have searched the existing issues
RainbowKit Version
2.1.1
wagmi Version
2.9.8
Current Behavior
When disconnect, the website will connect to previous wallet
Expected Behavior
Disconnect from all wallets
Steps To Reproduce
https://github.com/rainbow-me/rainbowkit/assets/6268441/0497a6dd-fc2c-45c7-84f7-97ebf4cea158
- Visit https://www.rainbowkit.com/docs/introduction
- Connect MetaMask extension wallet
- Disconnect MetaMask extension wallet and connect OKX wallet with WalletConnect
- Click Disconnect button
It will disconnect the OKX wallet, and connect to MetaMask wallet immediately
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
No response
Wagmi supports multiple wallet connections at once by default.
It will also reconnect on mount to multiple wallets which you've connected before. You can set reconnectOnMount to false in <WagmiProvider>. Check out the docs for reference here https://wagmi.sh/react/api/WagmiProvider#reconnectonmount
hi @magiziz thanks for your suggestion, but this won't fix the issue, and this is not the expected behavior.
because once we add reconnectOnMount to false, when we connect to Metamask and refresh the page, the connect will lost.
We found this issue when upgrading from 1.x to 2.x
@futantan I see! Wagmi has a feature called "shim disconnects" that will remember which connector has been disconnected, and avoid reconnecting that connector on the next mount. There is an outstanding issue that seems to exist inside of Wagmi that we are currently investigating with the Wagmi team. We hope this will be resolved soon. https://github.com/wevm/wagmi/issues/3606
thank you @DanielSinclair how about we reopen this issue to track how it goes?
@futantan Are you still able to reproduce this with the latest Wagmi version 2.11.1 ?
This should now be fixed in the latest Wagmi version 2.12.0.