metamask-extension
metamask-extension copied to clipboard
fix: add fallback method for currency formatter in `useFiatFormatter` hook
Description
This PR goal is to add a fallback for unknown currency formats to render it ${amount} ${currency} format.
Related issues
Fixes: https://github.com/MetaMask/metamask-extension/issues/24558
Manual testing steps
- Go to Settings > General
- Change your currency to Storj
- Start a send transaction on Ethereum with any value
- MM doesn't crash and shows
amount storj
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [x] I’ve followed MetaMask Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [X] I’ve applied the right labels on the PR (see labeling guidelines). 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.