Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add fallback method for currency formatter in useFiatFormatter hook #24563

Merged
merged 2 commits into from
May 17, 2024

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented May 16, 2024

Description

This PR goal is to add a fallback for unknown currency formats to render it ${amount} ${currency} format.

Open in GitHub Codespaces

Related issues

Fixes: #24558

Manual testing steps

  1. Go to Settings > General
  2. Change your currency to Storj
  3. Start a send transaction on Ethereum with any value
  4. MM doesn't crash and shows amount storj

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • 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.

@OGPoyraz OGPoyraz added the team-confirmations Push issues to confirmations team label May 16, 2024
@OGPoyraz OGPoyraz requested a review from a team as a code owner May 16, 2024 13:49
@OGPoyraz OGPoyraz changed the title Adds fallback method for currency formatter in useFiatFormatter hook fix: add fallback method for currency formatter in useFiatFormatter hook May 16, 2024
Copy link
Contributor

@digiwand digiwand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Lgtm

@OGPoyraz OGPoyraz merged commit c897b49 into develop May 17, 2024
70 of 72 checks passed
@OGPoyraz OGPoyraz deleted the fix/unknown-currency-format-for-fiat-formatter branch May 17, 2024 09:56
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2024
@metamaskbot metamaskbot added the release-11.18.0 Issue or pull request that will be included in release 11.18.0 label May 17, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [ff37d1c]
Page Load Metrics (892 ± 542 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint62170972914
domContentLoaded9341563
load5025698921129542
domInteractive9341563
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 45 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.18.0 Issue or pull request that will be included in release 11.18.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: MM crashes during confirmations with some currencies
4 participants