From ed87b27be09c976bcb9ee6ace0c5caa33a5d6172 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Sun, 10 Nov 2019 03:26:22 -0500 Subject: [PATCH] Fix advanced tab gas chart The gas chart on the advanced tab was not converting the gas price selected into hex before setting it in state, resulting in the UI throwing errors and the price being set incorrectly. It now converts in the same manner as the input fields. --- .../advanced-tab-content.component.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js index 853889e8dab1..306dd03a0885 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js @@ -1,5 +1,8 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' +import { + decGWEIToHexWEI, +} from '../../../../../helpers/utils/conversions.util' import Loading from '../../../../ui/loading-screen' import GasPriceChart from '../../gas-price-chart' import AdvancedGasInputs from '../../advanced-gas-inputs' @@ -42,6 +45,11 @@ export default class AdvancedTabContent extends Component { ) } + onGasChartUpdate = (price) => { + const { updateCustomGasPrice } = this.props + updateCustomGasPrice(decGWEIToHexWEI(price)) + } + render () { const { t } = this.context const { @@ -78,7 +86,7 @@ export default class AdvancedTabContent extends Component { ?
{ t('liveGasPricePredictions') }
{!gasEstimatesLoading - ? + ? : }