Skip to content

Remove duplicate percent sign from MetaMask fee#9647

Merged
Gudahtt merged 2 commits intodevelopfrom
fix-metamask-fee-double-percent-sign
Oct 19, 2020
Merged

Remove duplicate percent sign from MetaMask fee#9647
Gudahtt merged 2 commits intodevelopfrom
fix-metamask-fee-double-percent-sign

Conversation

@Gudahtt
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt commented Oct 19, 2020

The MetaMask fee is shown with two percent signs on the view quote page, because the percent sign is embedded in the fee amount as well as in the localized message.

The fee amount used now comes from the API, and does not have a percent sign. The percent sign is now only in the localized message. This allows for different locales to display the percentage differently. The old hard-coded value with a percent sign embedded has been removed, as it is no longer used anywhere.

The MetaMask fee is shown with two percent signs on the view quote
page, because the percent sign is embedded in the fee amount as well as
in the localized message.

The percent sign has been removed from the amount, and is now only in
the localized message. This allows for different locales to display the
percentage differently.

Note that we should still do further deduplication, as the fee is
currently hard-coded, fetched from the `/fee` endpoint, and embedded in
each individual quote. Currently the fee embedded in the quote is not
used, but the other two are.
@Gudahtt
Copy link
Copy Markdown
Member Author

Gudahtt commented Oct 19, 2020

Screenshots: Before:

double-percent

After:

percent-after

@Gudahtt Gudahtt marked this pull request as ready for review October 19, 2020 22:44
@Gudahtt Gudahtt requested a review from a team as a code owner October 19, 2020 22:44
@Gudahtt Gudahtt requested a review from danfinlay October 19, 2020 22:44
@danjm
Copy link
Copy Markdown
Contributor

danjm commented Oct 19, 2020

This was my mistake. I think we should just use the fee from the api. We could use const metaMaskFee = useSelector(getMetaMaskFeeAmount) in this file instead of getting it from renderableDataForUsedQuote

@danjm
Copy link
Copy Markdown
Contributor

danjm commented Oct 19, 2020

My above comment does not need to block this PR or release, but we will want to switch to the api value only before release to chrome store.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [1bcfa00]
Page Load Metrics (384 ± 46 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint28423542
domContentLoaded2936073829546
load2956083849546
domInteractive2936073829546

tmashuang
tmashuang previously approved these changes Oct 19, 2020
The hard-coded MetaMask fee has been removed. The spot where this was
used has been replaced with the fee in the swaps Redux slice, which is
from the API `/fee` route.
@Gudahtt
Copy link
Copy Markdown
Member Author

Gudahtt commented Oct 19, 2020

@danjm I have updated this to remove the hard-coded fee, and use the API fee instead. It was a simple enough change.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [930f2cb]
Page Load Metrics (394 ± 45 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint299440178
domContentLoaded3026103929445
load3036123949445
domInteractive3016103929445

@Gudahtt Gudahtt merged commit 4cab30e into develop Oct 19, 2020
@Gudahtt Gudahtt deleted the fix-metamask-fee-double-percent-sign branch October 19, 2020 23:28
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants