Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UX: Multichain: Fix useAccountTotalFiatBalance when getWeiHexFromDeci…
…malValue returns "NaN" (#21359) ## **Description** While onboarding with `MULTICHAIN` environment variable turned on, I noticed a crash upon initial loading screen. The cause was `getWeiHexFromDecimalValue` returning "NaN" in this block: ``` const totalWeiBalance = getWeiHexFromDecimalValue({ value: totalFiatBalance, fromCurrency: currentCurrency, conversionRate, invertConversionRate: true, }); ``` with params: * `value`: `"0"` * `fromCurrency`: `"usd"` * `conversionRate`: `0` Checking for valid output and returning `0x0` prevents the balance error ## **Manual testing steps** 0. `MULTICHAIN=1 yarn start` _1. Remove your local Metamask _2. Re-install and go through onboarding _3. Get to home wallet screen without crashing ## **Related issues** _Fixes #???_ ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained: - [ ] What problem this PR is solving. - [ ] How this problem was solved. - [ ] How reviewers can test my changes. - [ ] I’ve indicated what issue this PR is linked to: Fixes #??? - [ ] I’ve included tests if applicable. - [ ] I’ve documented any added code. - [ ] 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)). - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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.
- Loading branch information