1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

send-footer.utils.js - addressIsNew - improve readability

This commit is contained in:
kumavis 2019-03-29 13:34:49 +08:00
parent 356ef794f2
commit 0961449ca0

View File

@ -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 = {