Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry-pick: fix swaps modal render #30119

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

darkwing
Copy link
Contributor

@darkwing darkwing commented Feb 4, 2025

📦 🚀

#30118

Ensures the swaps balances display ASAP so as to not block asset selection.


Co-authored-by: MetaMask Bot [email protected]
Co-authored-by: Matthew Walsh [email protected]
Co-authored-by: Micaela Estabillo [email protected]
Co-authored-by: Dan J Miller [email protected]
Co-authored-by: Nidhi Kumari [email protected]
Co-authored-by: Derek Brans [email protected]

Description

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

## **Description**

Fixes swap modal render balance refresh once balances are fetched.

The tokensWithBalances
[here](https://github.com/MetaMask/metamask-extension/blob/af80c7b2e1fefada9b7ccbeb270eaaf0644eec2a/ui/pages/swaps/prepare-swap-page/prepare-swap-page.js#L245)
is empty for a short time and then populated but the swap modal does not
update when the list of balances is populated.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/30118?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

To reprouce is a bit random; so you might need to run the steps couple
times

1. Import an account with tokens
2. Click on swap button and click quickly on 'from token"
3. Even if initially for a split of second the balances are empty; the
list should be updated correctly shortly after


## **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/a890ed89-b1cb-47e6-a55b-0d85a08acbc2



### **After**

<!-- [screenshots/recordings] -->


https://github.com/user-attachments/assets/4199cdf0-f028-4659-abd6-6dd81f86d268




## **Pre-merge author checklist**

- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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.
@darkwing darkwing requested a review from a team as a code owner February 4, 2025 23:43
Copy link
Contributor

github-actions bot commented Feb 4, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Collaborator

Builds ready [b9c02ed]
Page Load Metrics (1559 ± 54 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint34118611515291140
domContentLoaded13851803153611254
load13971819155911254
domInteractive237538199
backgroundConnect97525189
firstReactRender1591352512
getState480202110
initialActions00000
loadScripts10221393114810148
setupStore648994
uiStartup15652365177118589

@danjm danjm merged commit 82da05f into Version-v12.10.4 Feb 5, 2025
71 of 74 checks passed
@danjm danjm deleted the Version-v12.10.4-cherry-pick-swap branch February 5, 2025 08:19
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants