[Bug]: "accountsChanged" not triggered when account is not yet connected. #26011
Labels
external-contributor
regression-prod-11.16.15
Regression bug that was found in production in release 11.16.15
Sev3-low
Low severity; minimal to no impact upon users
team-wallet-api-platform
type-bug
type-enhancement
Describe the bug
I am using this event API: https://docs.metamask.io/wallet/reference/provider-api#accountschanged
The event is only emitted when the account is already connected to the dApp. I need to handle the use case that a user switches from a connected account to one that is not connected yet. It is ok if I can not see the address or interact with the account but I need to be notified of the change.
Would be great to know if this is an actual bug or intended behavior and there is another proper(!) workaround for my need.
Expected behavior
Event to be emitted when the user changes to an account that is not yet connected:
Screenshots/Recordings
No response
Steps to reproduce
Error messages or log output
Detection stage
In production (default)
Version
11.16.15
Build type
None
Browser
Firefox
Operating system
Linux
Hardware wallet
No response
Additional context
Using ethers 6 to create provider instance.
Severity
The text was updated successfully, but these errors were encountered: