Prevent users from adding custom token if decimals is an empty string.
This commit is contained in:
parent
dac66b8ee9
commit
91f91d92fe
|
@ -143,7 +143,10 @@ AddTokenScreen.prototype.validate = function () {
|
||||||
errors.customAddress = t('invalidAddress')
|
errors.customAddress = t('invalidAddress')
|
||||||
}
|
}
|
||||||
|
|
||||||
const validDecimals = customDecimals !== null && customDecimals >= 0 && customDecimals < 36
|
const validDecimals = customDecimals !== null
|
||||||
|
&& customDecimals !== ''
|
||||||
|
&& customDecimals >= 0
|
||||||
|
&& customDecimals < 36
|
||||||
if (!validDecimals) {
|
if (!validDecimals) {
|
||||||
errors.customDecimals = t('decimalsMustZerotoTen')
|
errors.customDecimals = t('decimalsMustZerotoTen')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue