From a5306a68a7a7fc885fc7b19b719dfe910dd736ac Mon Sep 17 00:00:00 2001 From: Uncle Fatso Date: Mon, 13 Jul 2026 16:12:50 +0300 Subject: [PATCH] connection to unknwon network from metamask fixed Signed-off-by: Uncle Fatso --- package.json | 2 +- src/components/TopBar/Wallet/InitialWalletView.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c6776a4..1e30436 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.7.51", + "version": "0.7.52", "type": "module", "scripts": { "dev": "vite", diff --git a/src/components/TopBar/Wallet/InitialWalletView.tsx b/src/components/TopBar/Wallet/InitialWalletView.tsx index 1a229e0..68bbf8a 100644 --- a/src/components/TopBar/Wallet/InitialWalletView.tsx +++ b/src/components/TopBar/Wallet/InitialWalletView.tsx @@ -115,7 +115,9 @@ function InitialWalletView({ isWalletOpen, address, chainId, onClose }) { const { chains } = useSwitchChain(); const chainName = useMemo(() => { - return chains.find(chain => chain.id === chainId).name.toLowerCase(); + const chain = chains.find(chain => chain.id === chainId) + if (!chain) return null + return chain.name.toLowerCase() }, [chains, chainId]) const onBtnClick = (dexName, from, to) => { @@ -131,7 +133,7 @@ function InitialWalletView({ isWalletOpen, address, chainId, onClose }) { } useEffect(() => { - if (isWalletOpen) { + if (isWalletOpen && chainName) { ReactGA.send({ hitType: "pageview", page: `/${chainName.toLowerCase()}/sidebar` }); } }, [isWalletOpen, chainName])