1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00

Prevent users from accidentally submitting two transactions by disabling button.

This commit is contained in:
Kevin Serrano 2017-06-26 15:47:53 -07:00
parent 8b5b2d8329
commit 615b8d05a1
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1

View File

@ -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
}
}