connection to unknwon network from metamask fixed

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-07-13 16:12:50 +03:00
parent 3ad84a886e
commit a5306a68a7
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
2 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.7.51",
"version": "0.7.52",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -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])