mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Ensure correct conversion of data before calling getGasFeeTimeEstimate (#11697)
This commit is contained in:
parent
b2cb38ab2d
commit
a1f8a65519
@ -8,6 +8,8 @@ import { useGasFeeEstimates } from '../../../hooks/useGasFeeEstimates';
|
|||||||
import { usePrevious } from '../../../hooks/usePrevious';
|
import { usePrevious } from '../../../hooks/usePrevious';
|
||||||
import { I18nContext } from '../../../contexts/i18n';
|
import { I18nContext } from '../../../contexts/i18n';
|
||||||
|
|
||||||
|
import { hexWEIToDecGWEI } from '../../../helpers/utils/conversions.util';
|
||||||
|
|
||||||
import Typography from '../../ui/typography/typography';
|
import Typography from '../../ui/typography/typography';
|
||||||
import {
|
import {
|
||||||
TYPOGRAPHY,
|
TYPOGRAPHY,
|
||||||
@ -58,10 +60,13 @@ export default function GasTiming({
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
isUnknownLow ||
|
isUnknownLow ||
|
||||||
priority !== previousMaxPriorityFeePerGas ||
|
(priority && priority !== previousMaxPriorityFeePerGas) ||
|
||||||
fee !== previousMaxFeePerGas
|
(fee && fee !== previousMaxFeePerGas)
|
||||||
) {
|
) {
|
||||||
getGasFeeTimeEstimate(priority, fee).then((result) => {
|
getGasFeeTimeEstimate(
|
||||||
|
hexWEIToDecGWEI(priority),
|
||||||
|
hexWEIToDecGWEI(fee),
|
||||||
|
).then((result) => {
|
||||||
if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) {
|
if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) {
|
||||||
setCustomEstimatedTime(result);
|
setCustomEstimatedTime(result);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user