diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-06-27 06:57:46 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-06-27 06:57:46 +0800 |
commit | 9962a3068b25283e62963338f2c686818f0baef7 (patch) | |
tree | 9f36ff0f11974399739f36d4a74e2cfbdc71a7a3 /ui | |
parent | f2cfbda1c968d4bb094cac4f80abe8eeb5225dcf (diff) | |
download | tangerine-wallet-browser-9962a3068b25283e62963338f2c686818f0baef7.tar tangerine-wallet-browser-9962a3068b25283e62963338f2c686818f0baef7.tar.gz tangerine-wallet-browser-9962a3068b25283e62963338f2c686818f0baef7.tar.bz2 tangerine-wallet-browser-9962a3068b25283e62963338f2c686818f0baef7.tar.lz tangerine-wallet-browser-9962a3068b25283e62963338f2c686818f0baef7.tar.xz tangerine-wallet-browser-9962a3068b25283e62963338f2c686818f0baef7.tar.zst tangerine-wallet-browser-9962a3068b25283e62963338f2c686818f0baef7.zip |
Change disabling button as state property.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/pending-tx.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 5d6954092..f33a5d948 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -27,6 +27,7 @@ function PendingTx () { this.state = { valid: true, txData: null, + submitting: false, } } @@ -316,7 +317,7 @@ PendingTx.prototype.render = function () { type: 'submit', value: 'ACCEPT', style: { marginLeft: '10px' }, - disabled: insufficientBalance || !this.state.valid || !isValidAddress, + disabled: insufficientBalance || !this.state.valid || !isValidAddress || this.state.submitting, }), h('button.cancel.btn-red', { @@ -410,16 +411,14 @@ PendingTx.prototype.resetGasFields = function () { PendingTx.prototype.onSubmit = function (event) { event.preventDefault() - const acceptButton = document.querySelector('input.confirm') - acceptButton.disabled = true const txMeta = this.gatherTxMeta() const valid = this.checkValidity() - this.setState({ valid }) + this.setState({ valid, submitting: true }) if (valid && this.verifyGasParams()) { this.props.sendTransaction(txMeta, event) } else { this.props.dispatch(actions.displayWarning('Invalid Gas Parameters')) - acceptButton.disabled = false + this.setState({ submitting: false }) } } |