diff --git a/packages/embark-ui/src/components/ContractOverview.js b/packages/embark-ui/src/components/ContractOverview.js index 2c21bb738..736525084 100644 --- a/packages/embark-ui/src/components/ContractOverview.js +++ b/packages/embark-ui/src/components/ContractOverview.js @@ -63,7 +63,8 @@ class ContractFunction extends Component { autoSetGasPrice(e) { e.preventDefault(); const newInputs = this.state.inputs; - newInputs.gasPrice = this.gasStation.getCurrentGas(); + const currentPrice = this.gasStation.getCurrentGas(); + newInputs.gasPrice = currentPrice >= 0 ? currentPrice : 'Estimate unavailable'; this.setState({inputs: newInputs}); } diff --git a/packages/embark-ui/src/components/GasStation.js b/packages/embark-ui/src/components/GasStation.js index 4b91c4738..52ade9b68 100644 --- a/packages/embark-ui/src/components/GasStation.js +++ b/packages/embark-ui/src/components/GasStation.js @@ -52,7 +52,7 @@ class GasStation extends Component { getCurrentGas() { const formattedGas = this.getGasOracleFormatted(); if (!formattedGas.length) { - return 'Too few blocks'; + return -1; } return this.getGasOracleFormatted()[this.state.gasOracleSliderIndex].gasPrice / this.PRICE_UNIT_DIVIDER; } diff --git a/packages/embark-ui/src/containers/GasStationContainer.js b/packages/embark-ui/src/containers/GasStationContainer.js index be99b5a5b..4168bbc09 100644 --- a/packages/embark-ui/src/containers/GasStationContainer.js +++ b/packages/embark-ui/src/containers/GasStationContainer.js @@ -20,7 +20,7 @@ class GasStationContainer extends Component { getCurrentGas() { if (!this.gasStation) { - return 'Unavailable'; + return -1; } return this.gasStation.getCurrentGas(); }