Events for wallet disconnect
Closed this issue · 4 comments
tobowers commented
I'd like a way to listen for disconnect events. If someone leaves a tab open over night the wallet can disconnect, but the app doesn't have a way to hear the disconnect and respond.
Describe the solution you'd like
I think the normal metamask way is to listen to 'accountsChanged' on the provider (btw, typescript types don't have 'on' defined). It seems like accountsChanged only fires on connect with the current wallet.
Describe alternatives you've considered
It looks like somewhere in the code it is firing a 'disconnect' but that isn't happening at logout at least.
ptrf commented
Bump!
caina-zampieri commented
Bump
himanshuchawla009 commented
This issue is resolved, It now emits accountsChanged on logout. Thanks,