From 0961449ca05e48c82961b58cce2b6ad5ca32714e Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 29 Mar 2019 13:34:49 +0800 Subject: send-footer.utils.js - addressIsNew - improve readability --- ui/app/components/app/send/send-footer/send-footer.utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui/app/components') 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 a63316336..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 || newAddress.toLowerCase() === address)) + const newAddressNormalized = newAddress.toLowerCase() + const foundMatching = toAccounts.some(({ address }) => address === newAddressNormalized) + return !foundMatching } module.exports = { -- cgit v1.2.3