From a1f8a655191a96beb486ab2ac2a760214fbc8aaa Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Fri, 30 Jul 2021 19:41:55 -0230 Subject: [PATCH] Ensure correct conversion of data before calling getGasFeeTimeEstimate (#11697) --- ui/components/app/gas-timing/gas-timing.component.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/components/app/gas-timing/gas-timing.component.js b/ui/components/app/gas-timing/gas-timing.component.js index 24ad349dc..edea0a924 100644 --- a/ui/components/app/gas-timing/gas-timing.component.js +++ b/ui/components/app/gas-timing/gas-timing.component.js @@ -8,6 +8,8 @@ import { useGasFeeEstimates } from '../../../hooks/useGasFeeEstimates'; import { usePrevious } from '../../../hooks/usePrevious'; import { I18nContext } from '../../../contexts/i18n'; +import { hexWEIToDecGWEI } from '../../../helpers/utils/conversions.util'; + import Typography from '../../ui/typography/typography'; import { TYPOGRAPHY, @@ -58,10 +60,13 @@ export default function GasTiming({ if ( isUnknownLow || - priority !== previousMaxPriorityFeePerGas || - fee !== previousMaxFeePerGas + (priority && priority !== previousMaxPriorityFeePerGas) || + (fee && fee !== previousMaxFeePerGas) ) { - getGasFeeTimeEstimate(priority, fee).then((result) => { + getGasFeeTimeEstimate( + hexWEIToDecGWEI(priority), + hexWEIToDecGWEI(fee), + ).then((result) => { if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) { setCustomEstimatedTime(result); }