Prevent users from adding custom token if decimals is an empty string.

feature/default_network_editable
Dan 7 years ago
parent dac66b8ee9
commit 91f91d92fe
  1. 5
      ui/app/add-token.js

@ -143,7 +143,10 @@ AddTokenScreen.prototype.validate = function () {
errors.customAddress = t('invalidAddress')
}
const validDecimals = customDecimals !== null && customDecimals >= 0 && customDecimals < 36
const validDecimals = customDecimals !== null
&& customDecimals !== ''
&& customDecimals >= 0
&& customDecimals < 36
if (!validDecimals) {
errors.customDecimals = t('decimalsMustZerotoTen')
}

Loading…
Cancel
Save