diff options
author | Dan J Miller <danjm.com@gmail.com> | 2018-03-20 17:17:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-20 17:17:45 +0800 |
commit | 5cdaf270f798218bddc72bde05d8ab77267cfb94 (patch) | |
tree | a857cf36325d9b537bf4bb3c6516cbd94284d912 | |
parent | 424e98f6a896df6a848a92ef318464abc505d83d (diff) | |
download | tangerine-wallet-browser-5cdaf270f798218bddc72bde05d8ab77267cfb94.tar.gz tangerine-wallet-browser-5cdaf270f798218bddc72bde05d8ab77267cfb94.tar.zst tangerine-wallet-browser-5cdaf270f798218bddc72bde05d8ab77267cfb94.zip |
Don't block user from setting gas if estimating gas returns errors. (#3627)
-rw-r--r-- | ui/app/components/send/gas-fee-display-v2.js | 7 | ||||
-rw-r--r-- | ui/app/components/send/send-v2-container.js | 1 | ||||
-rw-r--r-- | ui/app/css/itcss/components/send.scss | 6 | ||||
-rw-r--r-- | ui/app/send-v2.js | 7 |
4 files changed, 19 insertions, 2 deletions
diff --git a/ui/app/components/send/gas-fee-display-v2.js b/ui/app/components/send/gas-fee-display-v2.js index 0c6f76303..9aaa31b1e 100644 --- a/ui/app/components/send/gas-fee-display-v2.js +++ b/ui/app/components/send/gas-fee-display-v2.js @@ -18,6 +18,7 @@ GasFeeDisplay.prototype.render = function () { onClick, primaryCurrency = 'ETH', convertedCurrency, + gasLoadingError, } = this.props return h('div.send-v2__gas-fee-display', [ @@ -31,11 +32,13 @@ GasFeeDisplay.prototype.render = function () { convertedPrefix: '$', readOnly: true, }) - : h('div.currency-display', t('loading')), + : gasLoadingError + ? h('div..currency-display.currency-display--message', 'Set with the gas price customizer.') + : h('div.currency-display', t('loading')), h('button.send-v2__sliders-icon-container', { onClick, - disabled: !gasTotal, + disabled: !gasTotal && !gasLoadingError, }, [ h('i.fa.fa-sliders.send-v2__sliders-icon'), ]), diff --git a/ui/app/components/send/send-v2-container.js b/ui/app/components/send/send-v2-container.js index 1106902b7..d1319b6dc 100644 --- a/ui/app/components/send/send-v2-container.js +++ b/ui/app/components/send/send-v2-container.js @@ -48,6 +48,7 @@ function mapStateToProps (state) { primaryCurrency, convertedCurrency: getCurrentCurrency(state), data, + selectedAddress, amountConversionRate: selectedToken ? tokenToFiatRate : conversionRate, tokenContract: getSelectedTokenContract(state), unapprovedTxs: state.metamask.unapprovedTxs, diff --git a/ui/app/css/itcss/components/send.scss b/ui/app/css/itcss/components/send.scss index bb17e53cd..89739171d 100644 --- a/ui/app/css/itcss/components/send.scss +++ b/ui/app/css/itcss/components/send.scss @@ -660,6 +660,12 @@ &__gas-fee-display { width: 100%; + + .currency-display--message { + padding: 8px 38px 8px 10px; + display: flex; + align-items: center; + } } &__sliders-icon-container { diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index fc1df1f51..5ac59fc29 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -42,6 +42,7 @@ function SendTransactionScreen () { to: null, amount: null, }, + gasLoadingError: false, } this.handleToChange = this.handleToChange.bind(this) @@ -128,6 +129,10 @@ SendTransactionScreen.prototype.updateGas = function () { .then(([gasPrice, gas]) => { const newGasTotal = this.getGasTotal(gas, gasPrice) updateGasTotal(newGasTotal) + this.setState({ gasLoadingError: false }) + }) + .catch(err => { + this.setState({ gasLoadingError: true }) }) } else { const newGasTotal = this.getGasTotal(gasLimit, gasPrice) @@ -436,6 +441,7 @@ SendTransactionScreen.prototype.renderGasRow = function () { showCustomizeGasModal, gasTotal, } = this.props + const { gasLoadingError } = this.state return h('div.send-v2__form-row', [ @@ -448,6 +454,7 @@ SendTransactionScreen.prototype.renderGasRow = function () { conversionRate, convertedCurrency, onClick: showCustomizeGasModal, + gasLoadingError, }), ]), |