Open digiwand opened 1 month ago
Develop
, Settings->Advanced->Show conversion on test networks disabled - for certain test networks fat values are shown.
Sepolia, BNB Chain testnets - no conversion:
Arbitrum Sepolia, Polygon Amoy, Avalanche Fuji - fiat values displayed:
thanks @sleepytanya for the screenshots and additional cases above!
I've tested and also confirmed this issue exists for native testnets.
It appears a few places on confirmation pages rely only on the useCurrencyRateCheck (Security & Privacy > "Show balance and token price checker" setting value) where we display fiat values. However, we are expecting the display of the fiat value also to include showFiatInTestnets (Advanced > "Show conversion on test networks" setting value) in the logic.
I believe we'll want to use the getShouldShowFiat
for these instances which takes both the useCurrencyRateCheck and showFiatInTestnets checks, along with other conditions.
export function getShouldShowFiat(state) {
const isMainNet = getIsMainnet(state);
const isLineaMainNet = getIsLineaMainnet(state);
const isCustomNetwork = getIsCustomNetwork(state);
const conversionRate = getConversionRate(state);
const useCurrencyRateCheck = getUseCurrencyRateCheck(state);
const { showFiatInTestnets } = getPreferences(state);
return Boolean(
(isMainNet || isLineaMainNet || isCustomNetwork || showFiatInTestnets) &&
useCurrencyRateCheck &&
conversionRate,
);
}
unassigning myself to refine and reprioritize the issue
Describe the bug
Fiat values continue to show despite "Show conversion on test networks" (Advanced Settings) being disabled
Discovered in https://github.com/MetaMask/metamask-extension/pull/24854#issuecomment-2136464701
Expected behavior
Fiat conversion values should not show on test networks when "Show conversion on test networks" (Advanced Settings) being disabled
Screenshots/Recordings
Steps to reproduce
Error messages or log output
No response
Version
11.18.0
Build type
None
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
No response
Severity
No response