fix (cherry-pick): 0 token balance in send flow (#28136)#28151
Merged
danjm merged 1 commit intoVersion-v12.5.1from Oct 29, 2024
Merged
fix (cherry-pick): 0 token balance in send flow (#28136)#28151danjm merged 1 commit intoVersion-v12.5.1from
danjm merged 1 commit intoVersion-v12.5.1from
Conversation
## **Description** Fixes an issue where token balance showed as 0 during send flow. This occurred when clicking the token in the token list, then clicking the send button from the token details page. When going send first and then picking a token, picking `decimals` was a number:  But when going token first and then clicking send , `decimals` was a string and skipped calculating the balance.  `calcTokenAmount` seems to work with either string or number, so changing logic from #27083 which introduced the number check [](https://codespaces.new/MetaMask/metamask-extension/pull/28136?quickstart=1) ## **Related issues** Fixes: #28112 ## **Manual testing steps** 1. Click on an erc20 token on the token list 2. Click the send button on the token details page 3. Choose a destination account 4. The balance under the asset picker should be accurate ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **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/develop/.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/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.
Contributor
|
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. |
hjetpoluru
approved these changes
Oct 29, 2024
Collaborator
Builds ready [13a3537]
Page Load Metrics (1930 ± 125 ms)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picks #28136 (1fd9510). Original PR description:
Description
Fixes an issue where token balance showed as 0 during send flow. This occurred when clicking the token in the token list, then clicking the send button from the token details page.
When going send first and then picking a token, picking
decimalswas a number:But when going token first and then clicking send ,
decimalswas a string and skipped calculating the balance.calcTokenAmountseems to work with either string or number, so changing logic from#27083 which introduced the number check
Related issues
Fixes: #28112
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Standards.
Pre-merge reviewer checklist
Description
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist