Closed rootulp closed 2 years ago
@rootulp Oh yes, thanks for catching that. Indeed looks like a copy/paste mistake! A PR would be much appreciated.
I've actually patched this up just now, also updated the dependencies for the repo. Thanks again for the help!
I observed a bug while auditing this code.
handleChainChanged
currently doesn't dispatch aSET_CHAIN_ID
action. It looks like a copy + paste mistake fromhandleAccountsChanged
https://github.com/ChangoMan/web3modal-example/blob/e4cae617039adff40f35c64282ddddbf8128b280/pages/index.tsx#L174-L180
Per https://docs.ethers.io/v5/concepts/best-practices/#best-practices--network-changes I think it would be preferable to hard refresh the website if the chain changes. Happy to create a PR for this. The diff looks like: