Conversation
|
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. |
| if (details.standard === TokenStandard.ERC20) { | ||
| asset.balance = | ||
| details.balance && typeof details.decimals === 'number' | ||
| details.balance && details.decimals !== undefined |
There was a problem hiding this comment.
or maybe parseInt(details.decimals) >= 0. I'm not sure when this can be something unexpected. The number check was introduced to replace a truthiness check, which did not work for 0 decimal tokens.
There was a problem hiding this comment.
I did verify this PR still works for 0 decimal tokens
There was a problem hiding this comment.
This will also be false when balance === 0 - should change the details.balance to typeof details.balance, or is it typed well enough that we know that details.balance is never a number representation?
There was a problem hiding this comment.
I dont really know. Trying to make minimal changes when hotfixing things. The decimal check is the only bit that changed recently.
There was a problem hiding this comment.
its true that balance is a string in every place i can reproduce though
Builds ready [40d7d3f]
Page Load Metrics (2081 ± 74 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
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 checkRelated issues
Fixes: #28112
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist