diff --git a/app/ts/components/ui-utils.tsx b/app/ts/components/ui-utils.tsx index 6aceb2cb..1aebcfdb 100644 --- a/app/ts/components/ui-utils.tsx +++ b/app/ts/components/ui-utils.tsx @@ -177,11 +177,11 @@ export const getAddressBookEntryOrAFiller = (addressMetaData: readonly AddressBo } export const rpcEntriesToChainEntriesWithAllChainsEntry = (rpcEntries: RpcEntries): readonly ChainEntry[] => { - const chainsMap = new Map() - for (const { chainId, name } of rpcEntries) { - if (chainsMap.has(chainId)) continue - chainsMap.set(chainId, { name, chainId }) - } + const entries = rpcEntries.map(({ chainId }): [string, ChainEntry] => { + const chainIdString = String(Number(chainId)) + return [chainIdString, { chainId, name: CHAIN_NAMES.get(chainIdString) || chainIdString }] + }) + const chainsMap = new Map(entries) chainsMap.set('AllChains', { name: 'All Chains', chainId: 'AllChains' }) return [...chainsMap.values()] }