1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Allow sending 0 eth or tokens

This commit is contained in:
Dan 2017-10-30 19:34:21 -02:30
parent 716bbf67d7
commit e5391cf9fd

View File

@ -422,7 +422,7 @@ SendTransactionScreen.prototype.renderAmountRow = function () {
primaryCurrency, primaryCurrency,
convertedCurrency, convertedCurrency,
selectedToken, selectedToken,
value: amount, value: amount || '0x0',
conversionRate: amountConversionRate, conversionRate: amountConversionRate,
handleChange: this.handleAmountChange, handleChange: this.handleAmountChange,
validate: this.validateAmount, validate: this.validateAmount,
@ -512,7 +512,7 @@ SendTransactionScreen.prototype.renderFooter = function () {
errors: { amount: amountError, to: toError }, errors: { amount: amountError, to: toError },
} = this.props } = this.props
const noErrors = amountError === null && toError === null const noErrors = !amountError && toError === null
const errorClass = noErrors ? '' : '__disabled' const errorClass = noErrors ? '' : '__disabled'
return h('div.send-v2__footer', [ return h('div.send-v2__footer', [
@ -566,7 +566,7 @@ SendTransactionScreen.prototype.onSubmit = function (event) {
errors: { amount: amountError, to: toError }, errors: { amount: amountError, to: toError },
} = this.props } = this.props
const noErrors = amountError === null && toError === null const noErrors = !amountError && toError === null
if (!noErrors) { if (!noErrors) {
return return