aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-19 00:17:14 +0800
committerDan <danjm.com@gmail.com>2018-06-19 00:17:14 +0800
commit347d1984cf01b7a1a6af0415c8ec6b1eb4c7a7be (patch)
treec4a1bd55ba808bddf2ff67137964c0a272d21be3
parentadb71073c8c3d2e3f76dd7591e87d4b64074c24e (diff)
downloadtangerine-wallet-browser-347d1984cf01b7a1a6af0415c8ec6b1eb4c7a7be.tar
tangerine-wallet-browser-347d1984cf01b7a1a6af0415c8ec6b1eb4c7a7be.tar.gz
tangerine-wallet-browser-347d1984cf01b7a1a6af0415c8ec6b1eb4c7a7be.tar.bz2
tangerine-wallet-browser-347d1984cf01b7a1a6af0415c8ec6b1eb4c7a7be.tar.lz
tangerine-wallet-browser-347d1984cf01b7a1a6af0415c8ec6b1eb4c7a7be.tar.xz
tangerine-wallet-browser-347d1984cf01b7a1a6af0415c8ec6b1eb4c7a7be.tar.zst
tangerine-wallet-browser-347d1984cf01b7a1a6af0415c8ec6b1eb4c7a7be.zip
Revert to updating amount on blur of input change; update gas on blur of amount input change; validate onchange.
-rw-r--r--ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js8
-rw-r--r--ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js8
2 files changed, 11 insertions, 5 deletions
diff --git a/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js b/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
index e6cb405e9..8da36d3b7 100644
--- a/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
+++ b/ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
@@ -55,7 +55,6 @@ export default class SendAmountRow extends Component {
setMaxModeTo(false)
updateSendAmount(amount)
- this.validateAmount(amount)
}
updateGas (amount) {
@@ -87,8 +86,11 @@ export default class SendAmountRow extends Component {
<CurrencyDisplay
conversionRate={amountConversionRate}
convertedCurrency={convertedCurrency}
- onBlur={newAmount => this.updateGas(newAmount)}
- onChange={newAmount => this.updateAmount(newAmount)}
+ onBlur={newAmount => {
+ this.updateGas(newAmount)
+ this.updateAmount(newAmount)
+ }}
+ onChange={newAmount => this.validateAmount(newAmount)}
inError={inError}
primaryCurrency={primaryCurrency || 'ETH'}
selectedToken={selectedToken}
diff --git a/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js b/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js
index 6e6c80890..579e18585 100644
--- a/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js
+++ b/ui/app/components/send_/send-content/send-amount-row/tests/send-amount-row-component.test.js
@@ -143,16 +143,20 @@ describe('SendAmountRow Component', function () {
assert.deepEqual(selectedToken, { address: 'mockTokenAddress' })
assert.equal(value, 'mockAmount')
assert.equal(SendAmountRow.prototype.updateGas.callCount, 0)
+ assert.equal(SendAmountRow.prototype.updateAmount.callCount, 0)
onBlur('mockNewAmount')
assert.equal(SendAmountRow.prototype.updateGas.callCount, 1)
assert.deepEqual(
SendAmountRow.prototype.updateGas.getCall(0).args,
['mockNewAmount']
)
- assert.equal(SendAmountRow.prototype.updateAmount.callCount, 0)
+ assert.equal(SendAmountRow.prototype.updateAmount.callCount, 1)
+ assert.deepEqual(
+ SendAmountRow.prototype.updateAmount.getCall(0).args,
+ ['mockNewAmount']
+ )
assert.equal(SendAmountRow.prototype.validateAmount.callCount, 0)
onChange('mockNewAmount')
- assert.equal(SendAmountRow.prototype.updateAmount.callCount, 1)
assert.equal(SendAmountRow.prototype.validateAmount.callCount, 1)
assert.deepEqual(
SendAmountRow.prototype.validateAmount.getCall(0).args,