diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-19 09:13:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-19 09:13:15 +0800 |
commit | a67d3ecd46ac2b9932d1a4181bb76631b27629c2 (patch) | |
tree | d96b262074f506a1a7a48975dbf85e1374207851 /ui | |
parent | 190330db921d5549a3e4363308545fb702e0089c (diff) | |
parent | 7094d965291fa19f96145d122cb9f0f76da053c0 (diff) | |
download | tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.gz tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.bz2 tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.lz tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.xz tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.zst tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.zip |
Merge branch 'master' into NewUI-flat
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/tooltip.js | 2 | ||||
-rw-r--r-- | ui/app/components/transaction-list-item-icon.js | 2 | ||||
-rw-r--r-- | ui/app/components/transaction-list-item.js | 2 | ||||
-rw-r--r-- | ui/app/send.js | 13 | ||||
-rw-r--r-- | ui/app/util.js | 7 |
5 files changed, 19 insertions, 7 deletions
diff --git a/ui/app/components/tooltip.js b/ui/app/components/tooltip.js index edbc074bb..efab2c497 100644 --- a/ui/app/components/tooltip.js +++ b/ui/app/components/tooltip.js @@ -17,6 +17,6 @@ Tooltip.prototype.render = function () { return h(ReactTooltip, { position: position || 'left', title, - fixed: false, + fixed: true, }, children) } diff --git a/ui/app/components/transaction-list-item-icon.js b/ui/app/components/transaction-list-item-icon.js index 431054340..f442b05af 100644 --- a/ui/app/components/transaction-list-item-icon.js +++ b/ui/app/components/transaction-list-item-icon.js @@ -35,7 +35,7 @@ TransactionIcon.prototype.render = function () { case 'submitted': return h(Tooltip, { title: 'Pending', - position: 'bottom', + position: 'right', }, [ h('i.fa.fa-ellipsis-h', { style: { diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 880a288af..a40066dc7 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -65,7 +65,7 @@ TransactionListItem.prototype.render = function () { h(Tooltip, { title: 'Transaction Number', - position: 'bottom', + position: 'right', }, [ h('span', { style: { diff --git a/ui/app/send.js b/ui/app/send.js index b14c48e56..bfc569b7d 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -385,10 +385,15 @@ SendTransactionScreen.prototype.onSubmit = function (event) { // return this.props.dispatch(actions.displayWarning(message)) // } - // if ((!util.isValidAddress(recipient) && !txData) || (!recipient && !txData)) { - // message = 'Recipient address is invalid.' - // return this.props.dispatch(actions.displayWarning(message)) - // } + if ((util.isInvalidChecksumAddress(recipient))) { + message = 'Recipient address checksum is invalid.' + return this.props.dispatch(actions.displayWarning(message)) + } + + if ((!util.isValidAddress(recipient) && !txData) || (!recipient && !txData)) { + message = 'Recipient address is invalid.' + return this.props.dispatch(actions.displayWarning(message)) + } if (txData && !isHex(stripHexPrefix(txData))) { message = 'Transaction data must be hex string.' diff --git a/ui/app/util.js b/ui/app/util.js index be26e15a5..7aace1b3c 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -54,6 +54,7 @@ module.exports = { shortenBalance, getContractAtAddress, exportAsFile: exportAsFile, + isInvalidChecksumAddress, } function valuesFor (obj) { @@ -83,6 +84,12 @@ function isValidAddress (address) { return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed) } +function isInvalidChecksumAddress (address) { + var prefixed = ethUtil.addHexPrefix(address) + if (address === '0x0000000000000000000000000000000000000000') return false + return !isAllOneCase(prefixed) && !ethUtil.isValidChecksumAddress(prefixed) && ethUtil.isValidAddress(prefixed) +} + function isAllOneCase (address) { if (!address) return true var lower = address.toLowerCase() |