You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replicate network change actions in rpc modal (#29943)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
The issue occurred because switching networks from the RPC selector,
which is only available when there's a network with at least 2 RPCs, was
not performing the same actions as switching networks from clicking the
network list item directly.
I have created a handler for the actions that need to be performed and
passed it down to both the network list item and the rpc selector modal,
that way it ensures that the same actions occur.
A test has been added to the rpc modal to validate the new handler is
being called. Tests already exist in the network list to validate that
those actions are taking place, and they are still passing.
[](https://codespaces.new/MetaMask/metamask-extension/pull/29943?quickstart=1)
## **Related issues**
Fixes: #29260
## **Manual testing steps**
1. Ensure at least one of your networks has more than one RPC, so that
the RPC selector appears.
2. Set any network and, in the Tokens tab, select "Current network" as
the option.
3. Open the network selector and select another network by clicking in
the rpc url, which will open an rpc selector modal.
4. Select any of the RPCs and check that the tokens from the new network
appear and that "Current network" is still
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/3ac163d3-4f2e-4170-81f4-f3b4ccc8e3d3
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/7dc02f85-42e0-449e-a419-cc74fc936de7
## **Pre-merge author checklist**
- [X] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [X] I've completed the PR template to the best of my ability
- [X] I’ve included tests if applicable
- [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [X] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
0 commit comments