aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.js4
2 files changed, 5 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..abb2ebc77 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,9 @@ function constructUpdatedTx ({
}
function addressIsNew (toAccounts, newAddress) {
- return !toAccounts.find(({ address }) => newAddress === address)
+ const newAddressNormalized = newAddress.toLowerCase()
+ const foundMatching = toAccounts.some(({ address }) => address === newAddressNormalized)
+ return !foundMatching
}
module.exports = {