diff options
Diffstat (limited to 'old-ui/app')
-rw-r--r-- | old-ui/app/send.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/old-ui/app/send.js b/old-ui/app/send.js index 9ab064aea..0dc0fa778 100644 --- a/old-ui/app/send.js +++ b/old-ui/app/send.js @@ -247,6 +247,23 @@ 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 + const parts = input.split('') + + let message + + if (isNaN(input) || input === '') { + message = 'Invalid ether value.' + return this.props.dispatch(actions.displayWarning(message)) + } + + if (parts[1]) { + var decimal = parts[1] + if (decimal.length > 18) { + message = 'Ether amount is too precise.' + 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 |