aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui/app/send.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2018-01-04 03:35:14 +0800
committerGitHub <noreply@github.com>2018-01-04 03:35:14 +0800
commitdc9d8b24c6fccd584975c5b9f25c8090b7e8051d (patch)
tree732806322abf5602a17533caf1d6a875a97e10a6 /old-ui/app/send.js
parentdfb22471087f040d8345a5a17321e1462842045c (diff)
parent099f078a3d73b2aed30dc5e1cd3a2facde58606a (diff)
downloadtangerine-wallet-browser-dc9d8b24c6fccd584975c5b9f25c8090b7e8051d.tar.gz
tangerine-wallet-browser-dc9d8b24c6fccd584975c5b9f25c8090b7e8051d.tar.zst
tangerine-wallet-browser-dc9d8b24c6fccd584975c5b9f25c8090b7e8051d.zip
Merge pull request #2845 from alextsg/NewUI-flat-4.0.5c
[NewUI] Merge master into NewUI-flat
Diffstat (limited to 'old-ui/app/send.js')
-rw-r--r--old-ui/app/send.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/old-ui/app/send.js b/old-ui/app/send.js
index 9ab064aea..b40910236 100644
--- a/old-ui/app/send.js
+++ b/old-ui/app/send.js
@@ -247,10 +247,26 @@ 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
- let message
if (value.gt(balance)) {
message = 'Insufficient funds.'