MetaMask / MetaMask/metamask-extension
[Bug]: Wallet API - Switch networks with Add Tokens popup open, keeps that popup open with no tokens
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
### Describe the bug
Whenever I've performed and Add token action, while having that popup open, if I switch networks I see how the MM pending actions are cleared but the popup remains open with no token list.
### Expected behavior
I think we should close automatically the MM popup, in the same way the pending action is cleared from the icon
### Screenshots/Recordings
https://github.com/user-attachments/assets/1e5311a0-a5e2-4d4b-b62e-1cdd77819177
### Steps to reproduce
1. Go to the test dapp
2. Deploy an ERC20 token contract
3. Click Add token
4. Leave that window open and go to the full view
5. Change networks
6. See how the pending action is cleared but the poup remains open with no tokens
### Error messages or log output
_No response_
### Detection stage
In production (default)
### Version
12.3.1
### Build type
None
### Browser
Chrome
### Operating system
Linux
### Hardware wallet
_No response_
### Additional context
_No response_
### Severity
_No response_
Contributor guide
Research direction
Start with the test dapp flow: open Add token, move to the full view, and switch networks while the popup is open. Trace the Add token popup and network-switch behavior; done means the popup closes when the pending action is cleared, rather than remaining open with an empty token list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100