- Updated formatBalance in @utils/CashMethods.js which is used to format the header XEC balance. The new function takes in the balance and an optional locale parameter and returns a formatted value accordingly. This function previously hard coded spaces for large balances.
- New unit tests created in @utils/__tests__cashMEthods.test.js for the redesigned formatBalance function.
- New snapshots generated across Wallet, Send and Tokens UI.
Details
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABCf794bd8f5f86: [Cashtab] Make the header balance a localeString
- npm start
- navigate to Wallet, Tokens and Send UIs and ensure the header XEC balance is displayed correctly per locale.
- npm run extension
- Check header XEC balance is displayed per locale in browser extension mode
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
- wBalance variable changed to unformattedBalance
- Whitespace removal reverted as it was a local IDE issue rather than Prettier (not upgraded).
Comment Actions
removed first else block per feedback, retained second else block as it is needed to check for an optional parameter rather than error checking.
web/cashtab/src/utils/cashMethods.js | ||
---|---|---|
56 ↗ | (On Diff #30618) | Remove this else { } (keep the code inside, but just put it after the if block). because the if block already returns a value if (optionalLocale === undefined), the code behavior is identical whether or not the else is there. |