mento-protocol / governance-ui

An open source interface for the Mento protocol governance
https://governance.mento.org
0 stars 0 forks source link

Fix: Rainbow wallet #187

Closed RyRy79261 closed 3 months ago

RyRy79261 commented 3 months ago

Description

Rainbow wallet loosely implements expected functionality RPC endpoints, the add chain & disconnect functions in wagmi are not respected by Rainbow wallet.

Testing

To recreate the issue scenario. In Rainbow wallet, ensure you do not have Celo chain added. Ensure you are not connected to the app.

Click connect, this would previously cause a crash due to Rainbow wallet providing Eth Mainnet instead of Null in the window.ethereum

You should be presented with a modal, which has instructions on how to add Celo chain manually, clicking the retry refreshes the page.

Trying the connect process again should be successful

Notes

To achieve this, I had to put ensure chain logic as a wrapper for all components, I had to enforce accurate chain IDs manually since Rainbow wallet circumvents standard update logic to the window.ethereum object unlike all other wallets

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
governance-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2024 1:30pm