aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenny Pollack <jennypollack3@gmail.com>2019-03-29 10:18:53 +0800
committerJenny Pollack <jennypollack3@gmail.com>2019-03-29 10:18:53 +0800
commit356ef794f22de272b12cb84205da4fc8af463458 (patch)
tree04d8de45d041d988287a7e9d875b3d6c1da04ba5
parent649a1d483a574dcff902708f95b37329a02709a8 (diff)
downloadtangerine-wallet-browser-356ef794f22de272b12cb84205da4fc8af463458.tar.gz
tangerine-wallet-browser-356ef794f22de272b12cb84205da4fc8af463458.tar.zst
tangerine-wallet-browser-356ef794f22de272b12cb84205da4fc8af463458.zip
prevent add duplicates when address is not new
-rw-r--r--ui/app/components/app/send/send-footer/send-footer.container.js3
-rw-r--r--ui/app/components/app/send/send-footer/send-footer.utils.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/ui/app/components/app/send/send-footer/send-footer.container.js b/ui/app/components/app/send/send-footer/send-footer.container.js
index 502159a81..ea3fd7ee4 100644
--- a/ui/app/components/app/send/send-footer/send-footer.container.js
+++ b/ui/app/components/app/send/send-footer/send-footer.container.js
@@ -96,9 +96,10 @@ function mapDispatchToProps (dispatch) {
return dispatch(updateTransaction(editingTx))
},
+
addToAddressBookIfNew: (newAddress, toAccounts, nickname = '') => {
const hexPrefixedAddress = ethUtil.addHexPrefix(newAddress)
- if (addressIsNew(toAccounts)) {
+ if (addressIsNew(toAccounts, hexPrefixedAddress)) {
// TODO: nickname, i.e. addToAddressBook(recipient, nickname)
dispatch(addToAddressBook(hexPrefixedAddress, nickname))
}
diff --git a/ui/app/components/app/send/send-footer/send-footer.utils.js b/ui/app/components/app/send/send-footer/send-footer.utils.js
index f82ff1e9b..a63316336 100644
--- a/ui/app/components/app/send/send-footer/send-footer.utils.js
+++ b/ui/app/components/app/send/send-footer/send-footer.utils.js
@@ -74,7 +74,7 @@ function constructUpdatedTx ({
}
function addressIsNew (toAccounts, newAddress) {
- return !toAccounts.find(({ address }) => newAddress === address)
+ return !toAccounts.find(({ address }) => (newAddress === address || newAddress.toLowerCase() === address))
}
module.exports = {