aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-05-25 01:13:43 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-05-25 01:13:43 +0800
commit10ca3b6467af2bea723e661160ba5cf2a41ab3b0 (patch)
treefc625ad4b6735ce0d7391fb42f4aad2fb0a1565d
parent2d739647b909732c26a7725cb78cf018c71d6621 (diff)
downloadtangerine-wallet-browser-10ca3b6467af2bea723e661160ba5cf2a41ab3b0.tar.gz
tangerine-wallet-browser-10ca3b6467af2bea723e661160ba5cf2a41ab3b0.tar.zst
tangerine-wallet-browser-10ca3b6467af2bea723e661160ba5cf2a41ab3b0.zip
Fix bug where submit was enabled when invalid params were filled out.
-rw-r--r--CHANGELOG.md1
-rw-r--r--ui/app/components/bn-as-decimal-input.js2
-rw-r--r--ui/app/components/pending-tx.js14
3 files changed, 12 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2ad61254c..aea0df1fa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- Now when switching networks the extension does not restart
- Cleanup decimal bugs in our gas inputs.
+- Fix bug where submit button was enabled for invalid gas inputs.
## 3.7.0 2017-5-23
diff --git a/ui/app/components/bn-as-decimal-input.js b/ui/app/components/bn-as-decimal-input.js
index de01f8b5f..1d292ca2a 100644
--- a/ui/app/components/bn-as-decimal-input.js
+++ b/ui/app/components/bn-as-decimal-input.js
@@ -67,7 +67,7 @@ BnAsDecimalInput.prototype.render = function () {
const scaledNumber = this.upsize(value, scale, precision)
const precisionBN = new BN(scaledNumber, 10)
- onChange(precisionBN)
+ onChange(precisionBN, event.target.checkValidity())
},
onInvalid: (event) => {
const msg = this.constructWarning()
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index eed0fd9ae..8e63f5c76 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -346,18 +346,24 @@ PendingTx.prototype.miniAccountPanelForRecipient = function () {
}
}
-PendingTx.prototype.gasPriceChanged = function (newBN) {
+PendingTx.prototype.gasPriceChanged = function (newBN, valid) {
log.info(`Gas price changed to: ${newBN.toString(10)}`)
const txMeta = this.gatherTxMeta()
txMeta.txParams.gasPrice = '0x' + newBN.toString('hex')
- this.setState({ txData: clone(txMeta) })
+ this.setState({
+ txData: clone(txMeta),
+ valid,
+ })
}
-PendingTx.prototype.gasLimitChanged = function (newBN) {
+PendingTx.prototype.gasLimitChanged = function (newBN, valid) {
log.info(`Gas limit changed to ${newBN.toString(10)}`)
const txMeta = this.gatherTxMeta()
txMeta.txParams.gas = '0x' + newBN.toString('hex')
- this.setState({ txData: clone(txMeta) })
+ this.setState({
+ txData: clone(txMeta),
+ valid,
+ })
}
PendingTx.prototype.resetGasFields = function () {