diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-12-28 09:36:56 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-12-28 09:36:56 +0800 |
commit | 92eb16fc112eeac749c0ddfff163773ce3a35ef2 (patch) | |
tree | 786dec58fbb970d206906b246ddc92cbeb1fb5b2 | |
parent | adf4b89804af8b8f4e9a543a912f548715720d64 (diff) | |
download | tangerine-wallet-browser-92eb16fc112eeac749c0ddfff163773ce3a35ef2.tar tangerine-wallet-browser-92eb16fc112eeac749c0ddfff163773ce3a35ef2.tar.gz tangerine-wallet-browser-92eb16fc112eeac749c0ddfff163773ce3a35ef2.tar.bz2 tangerine-wallet-browser-92eb16fc112eeac749c0ddfff163773ce3a35ef2.tar.lz tangerine-wallet-browser-92eb16fc112eeac749c0ddfff163773ce3a35ef2.tar.xz tangerine-wallet-browser-92eb16fc112eeac749c0ddfff163773ce3a35ef2.tar.zst tangerine-wallet-browser-92eb16fc112eeac749c0ddfff163773ce3a35ef2.zip |
Add frontend validation to check if send ether input is a valid number.
-rw-r--r-- | ui/app/send.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/app/send.js b/ui/app/send.js index e59c1130e..7b31eef7e 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -247,6 +247,12 @@ SendTransactionScreen.prototype.onSubmit = function () { const recipient = state.recipient || document.querySelector('input[name="address"]').value.replace(/^[.\s]+|[.\s]+$/g, '') const nickname = state.nickname || ' ' const input = document.querySelector('input[name="amount"]').value + + if (isNaN(input)) { + message = 'Invalid ether value.' + return this.props.dispatch(actions.displayWarning(message)) + } + const value = util.normalizeEthStringToWei(input) const txData = document.querySelector('input[name="txData"]').value const balance = this.props.balance |