Choice on which network to connect to on init #64
Replies: 2 comments 2 replies
-
From another user's perspective: As for the "desiredNetworkID", my suggestion is for you to either save the user's preferred network in local storage and grab that prior to initializing, or query the wallet for the chainId via window.ethereum prior to wagmi init, as you cant use the package to query when its the data you need to initialize (race condition) |
Beta Was this translation helpful? Give feedback.
-
We've released an update in ConnectKit Hopefully this helps resolve some issues 🙏 |
Beta Was this translation helpful? Give feedback.
-
Hi, great work here and I'm a happy user! I am now working on a website which works on 2 chains though, Matic and a custom new chain (Alt) and the users will be quite divided between the two - but because of my chain order it always automatically connects to Matic after which we can open the modal and change the network again, quite a few extra steps especially since the connection resets on refresh.
I know of the initialChainId that I can set, but this is less than desired and feels like a hack to check if a wallet is already open in the browser and possibly take the connected chain id and set it in the ConnectKitProvider on init ...
Could an option be added to, when more than one chain has been given to Wagmi, we first get a Chain selector modal before trying to connect?
Also, is there a way to customize the modal in such a big way that changing networks doesn't need a dropdown to be opened etc?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions