aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-10-24 12:22:22 +0800
committerDan Miller <danjm.com@gmail.com>2018-12-04 11:36:05 +0800
commitd14af8346af2517db2e50f142377948c9f2ae5e9 (patch)
treeccdfe345dd000b44c0eedfbee0037969ff2d6f38 /ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
parentd0619b024fb092182e77e16c6742e157c89b2dc9 (diff)
downloadtangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.tar
tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.tar.gz
tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.tar.bz2
tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.tar.lz
tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.tar.xz
tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.tar.zst
tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.zip
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.js20
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),