Describe the bug
If you use the Disconnect button inside the Template's wallet, this seems to only disconnect it internally from the app. If you hit 'connect' again it will reconnect to the same account.
This is perfectly normal behavior.
To connect to a different account you need to disconnect using Metamask's > Connected Sites > disconnect.
Which works.
As soon as you do this, however the Metamask connect in the App pops up. It feels a bit intrusive and I think this should be prevented from happening.
The bug is that after disconnecting either way (App or MM), the EventChannel on listenAccountChange()
in Wallet.ts
(ethers 6 - I haven't tried 5) is not firing. Thus your app is not aware of the account disconnection.
I understand that you would most likely isProtected
your page. But I don't think you should rely on that and I think the listener should be consistent and complete.
To Reproduce
Steps to reproduce the behavior:
- Connect to account
- Go to metamask in browser and disconnect account from site
- In a Page that uses
EventChannel
on listenAccountChange()
, the event doesnt fire so your page is unaware of the change.
Expected behavior
Your pages that use EventChannel
on listenAccountChange()
should fire when an account is disconnected either in App or via Metamask.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS] MacOS 13.6.3
- Browser [e.g. chrome, safari] Brave
- Version [e.g. 22] v1.62.153
Smartphone (please complete the following information):
- Device: [e.g. iPhone6] NA
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.