I cannot detect network change #3379
Unanswered
javierguzman
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
I am learning ethers & web3 in general and I do not manage to make the network/account change detection mechanism to work properly.
I have the following code:
So if I use window.ethereum.on it seems to work, but provider.on('network') is not triggered when I change chain. Also, is there a similar listener for an account change?
As far as I have understood, the usage of window.ethereum.on is not ethers implementation and listening to network it is ethers implementation that is why I would like to have it working on "ethers way".
Any clue why is not working?
Thank you in advance and regards,
Javier Guzman
Beta Was this translation helpful? Give feedback.
All reactions