1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Improving getMemoizedMetadataContractName selector (#17432)

This commit is contained in:
Jyoti Puri 2023-01-26 21:09:13 +05:30 committed by ryanml
parent 62bca62273
commit 58b5332b67

View File

@ -831,8 +831,9 @@ export const getMemoizedMetadataContractName = createDeepEqualSelector(
getTokenList,
(_tokenList, address) => address,
(tokenList, address) => {
const checksumHexAddress = toChecksumHexAddress(address);
const entry = Object.values(tokenList).find((identity) =>
isEqualCaseInsensitive(identity.address, toChecksumHexAddress(address)),
isEqualCaseInsensitive(identity.address, checksumHexAddress),
);
return entry && entry.name !== '' ? entry.name : '';
},