mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-03 14:44:27 +01:00
Prevent users from accidentally submitting two transactions by disabling button.
This commit is contained in:
parent
8b5b2d8329
commit
615b8d05a1
@ -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…
Reference in New Issue
Block a user