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

Improving getMemoizedMetadataContractName selector (#17432)

This commit is contained in:
Jyoti Puri 2023-01-26 21:09:13 +05:30 committed by GitHub
parent 3e3abcafc2
commit 5a493fb38e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -830,8 +830,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 : '';
},