From 58a7f6612f722391a2524634c4359b7ab2cec660 Mon Sep 17 00:00:00 2001 From: delivan Date: Fri, 13 Sep 2024 15:18:34 +0900 Subject: [PATCH] Fix a logic for hiding evm chain on mobile --- src/chain-list.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/chain-list.js b/src/chain-list.js index cc36cff04..14b7ca07c 100644 --- a/src/chain-list.js +++ b/src/chain-list.js @@ -79,24 +79,31 @@ async function init() { removeChainListChild(); - const filteredChainInfos = chainInfos.filter( - (chainInfo) => - !registeredChainIds - .includes(parse(chainInfo.chainId).identifier) - .filter( - (chainInfo) => - isOnKeplrMobile && chainInfo.chainId.startsWith("eip155:"), - ), - ); + const filteredChainInfos = chainInfos + .filter( + (chainInfo) => + !registeredChainIds.includes(parse(chainInfo.chainId).identifier), + ) + .filter((chainInfo) => { + if (isOnKeplrMobile) { + return !chainInfo.chainId.startsWith("eip155:"); + } else { + return true; + } + }); const registeredChainInfos = chainInfos .filter((chainInfo) => chainInfo.nodeProvider) .filter((chainInfo) => registeredChainIds.includes(parse(chainInfo.chainId).identifier), ) - .filter( - (chainInfo) => isOnKeplrMobile && chainInfo.chainId.startsWith("eip155:"), - ); + .filter((chainInfo) => { + if (isOnKeplrMobile) { + return !chainInfo.chainId.startsWith("eip155:"); + } else { + return true; + } + }); if (filteredChainInfos.length > 0) { filteredChainInfos.map((chainInfo) => {