diff options
Improve data management and tests for gas-modal-page-container price estimates.
Diffstat (limited to 'ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js')
-rw-r--r-- | ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js b/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js index 67c1ff2e3..64b94e66c 100644 --- a/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js +++ b/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js @@ -24,13 +24,16 @@ import { getSelectedToken, } from '../../../selectors.js' import { - getCustomGasPrice, - getCustomGasLimit, - getRenderableBasicEstimateData, - getBasicGasEstimateLoadingStatus, + formatTimeEstimate, getAveragePriceEstimateInHexWEI, + getBasicGasEstimateLoadingStatus, + getCustomGasLimit, + getCustomGasPrice, getDefaultActiveButtonIndex, - formatTimeEstimate, + getEstimatedGasPrices, + getEstimatedGasTimes, + getPriceAndTimeEstimates, + getRenderableBasicEstimateData, } from '../../../selectors/custom-gas' import { formatCurrency, @@ -69,9 +72,8 @@ const mapStateToProps = state => { const customGasPrice = calcCustomGasPrice(customModalGasPriceInHex) - const priceAndTimeEstimates = state.gas.priceAndTimeEstimates - const gasPrices = priceAndTimeEstimates.map(({ gasprice }) => gasprice) - const estimatedTimes = priceAndTimeEstimates.map(({ expectedTime }) => expectedTime) + const gasPrices = getEstimatedGasPrices(state) + const estimatedTimes = getEstimatedGasTimes(state) return { hideBasic, @@ -81,7 +83,7 @@ const mapStateToProps = state => { customGasPrice, customGasLimit: calcCustomGasLimit(customModalGasLimitInHex), newTotalFiat, - currentTimeEstimate: getRenderableTimeEstimate(customGasPrice, priceAndTimeEstimates), + currentTimeEstimate: getRenderableTimeEstimate(customGasPrice, getPriceAndTimeEstimates(state)), gasPriceButtonGroupProps: { buttonDataLoading, defaultActiveButtonIndex: getDefaultActiveButtonIndex(gasButtonInfo, customModalGasPriceInHex), |