From 0961449ca05e48c82961b58cce2b6ad5ca32714e Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 29 Mar 2019 13:34:49 +0800 Subject: [PATCH] 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(-) 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 a63316336ed7..abb2ebc77f3e 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 = {