Skip to content

Commit

Permalink
fix: Issue 28509 - when navigating to send/swap from a token from a c…
Browse files Browse the repository at this point in the history
…hain that is not on the selected network, ensure correct balance is prepopulated in fromToken amount
  • Loading branch information
gambinish committed Nov 18, 2024
1 parent 8bf9eaf commit 0235189
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ui/pages/asset/components/asset-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ const AssetPage = ({
tokenMarketDetails.allTimeHigh > 0 ||
tokenMarketDetails.allTimeLow > 0);

// this is needed in order to assign the correct balances to TokenButtons before sending/swapping
// without this, the balances we be populated as zero until the user refreshes the screen: https://github.com/MetaMask/metamask-extension/issues/28509
asset.balance = {
value: '', // decimal value not needed
display: String(balance),
fiat: String(tokenFiatAmount),
};

return (
<Box
marginLeft="auto"
Expand Down

0 comments on commit 0235189

Please sign in to comment.