aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2017-06-27 07:32:47 +0800
committerGitHub <noreply@github.com>2017-06-27 07:32:47 +0800
commit8194b398f6a2f3756e551c068a2dc8c150495c7d (patch)
treeeac91e50b77c6452faebed9324a187003a5b2711
parentd6c14f46091f716195b89eb27233d9fc4ae8f5b0 (diff)
parent62c4501160b23e526ea4a5d496182666273fbf66 (diff)
downloadtangerine-wallet-browser-8194b398f6a2f3756e551c068a2dc8c150495c7d.tar
tangerine-wallet-browser-8194b398f6a2f3756e551c068a2dc8c150495c7d.tar.gz
tangerine-wallet-browser-8194b398f6a2f3756e551c068a2dc8c150495c7d.tar.bz2
tangerine-wallet-browser-8194b398f6a2f3756e551c068a2dc8c150495c7d.tar.lz
tangerine-wallet-browser-8194b398f6a2f3756e551c068a2dc8c150495c7d.tar.xz
tangerine-wallet-browser-8194b398f6a2f3756e551c068a2dc8c150495c7d.tar.zst
tangerine-wallet-browser-8194b398f6a2f3756e551c068a2dc8c150495c7d.zip
Merge branch 'master' into i1584-seederror
-rw-r--r--CHANGELOG.md1
-rw-r--r--ui/app/components/pending-tx.js6
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bcae3943e..96dc79d9a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@
- Fix bug where badge count did not reflect personal_sign pending messages.
- Seed word confirmation wording is now scarier.
- Fix error for invalid seed words.
+- Prevent users from submitting two duplicate transactions by disabling submit.
## 3.7.8 2017-6-12
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 4b1a00eca..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', {
@@ -412,11 +413,12 @@ PendingTx.prototype.onSubmit = function (event) {
event.preventDefault()
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'))
+ this.setState({ submitting: false })
}
}