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
## **Description**
When `PORTFOLIO_VIEW` feature flag is enabled, when swapping a native
token from a different chain than the globally selected chain, the
incorrect native token would be prepoulated in the `fromToken` in the
swap UI.
For instance, if user is on Ethereum mainnet, navigated to POL, then
attempted to swap, the globally selected network would change from
Ethereum mainnet to Polygon mainnet (expected), but the swaps
`fromToken` would still be POL (unexpected)
Changes in this PR fixes this, and prepoulates `fromToken` with the
native token from the correct chain.
[](https://codespaces.new/MetaMask/metamask-extension/pull/28639?quickstart=1)
## **Related issues**
Fixes: #28534
## **Manual testing steps**
1. `PORTFOLIO_VIEW=1 yarn webpack --watch`
2. Import wallet with at least two networks added
3. When "All Networks" is toggled, attempt to swap a native token from
another network. Ensure that the token prepopulated in the swap UI is
the native token from the correct chain
4. Ensure swap completes successfully.
## **Screenshots/Recordings**
https://github.com/user-attachments/assets/016ffa54-9ed1-450c-9aa0-da27f0fd6caa
## **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/develop/.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/develop/.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.
---------
Co-authored-by: David Walsh <[email protected]>
0 commit comments