[SOLVED] How to listen to a wallet disconnect?

I am using listening to isWeb3Enabled changes by using a react hook, but when I manually disconnect from the site in metamask isWeb3Enabled is not updated. How can I listen to manual disconnects?

1 Like

maybe there are some events that are sent by metamask when it was disconnected

or maybe you can check if it is still connected by trying to get the current chain id, if it doesnโ€™t work to get the chain id then probably it is not connected

@alexqnder are you sure you have isWeb3Enabled as a dep in the dependency array. can u paste your code so to see hat its doing

I ended up just using web3uikitโ€™s connect button.

How do I close this forum?

1 Like