Closed QalbeHabib closed 1 week ago
@QalbeHabib Thanks for spotting the bug, i'm able to reproduce this as well. We've had a few unusual behaviors from MetaMask lately and i'll report this to the Wagmi team 👍
@QalbeHabib This seems to be a MetaMask issue. Wagmi is also impacted by this https://github.com/wevm/wagmi/issues/3998
Closing this issue since this is a MetaMask specific issue which is impacted by all dApps.
Is there an existing issue for this?
RainbowKit Version
2.0.5
wagmi Version
2.5.20
Current Behavior
I encountered an issue when using RainbowKit with MetaMask in my application as well as in some of the popular application like
https://www.rainbowkit.com/docs/connect-button https://app.cabana.fi/ https://www.base.org/ecosystem https://swap.defillama.com/ https://pro.opensea.io/
. The problem arises when the user changes the network in MetaMask after initially connecting to the application. Here are the steps to reproduce the issue:
Connect to the application using MetaMask. Ensure MetaMask is connected to a supported chain. Change the network in MetaMask to the unsupported chain. Reload the browser tab. It shows the connected button with the last chain instead of showing "Wrong wallet" as the chain is not supported in Metamask.
Expected Behavior
Steps To Reproduce
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
I have attached a reference video showcasing the issue for better understanding: Watch Video
The video demonstrates the problem where the ConnectButton displays the wallet connected to the last stored chain instead of the current chain in MetaMask after a network change. This issue is reproducible and affects user experience, especially in scenarios where network changes are frequent.
Your attention to this matter and feedback on resolving this issue would be highly appreciated.