Prevent users from accidentally submitting two transactions by disabling button.

feature/default_network_editable
Kevin Serrano 7 years ago
parent 8b5b2d8329
commit 615b8d05a1
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1
  1. 3
      ui/app/components/pending-tx.js

@ -410,6 +410,8 @@ 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 })
@ -417,6 +419,7 @@ PendingTx.prototype.onSubmit = function (event) {
this.props.sendTransaction(txMeta, event)
} else {
this.props.dispatch(actions.displayWarning('Invalid Gas Parameters'))
acceptButton.disabled = false
}
}

Loading…
Cancel
Save