From 41100d1d8f5e8f575fe68386fa3153db8a61ec2b Mon Sep 17 00:00:00 2001 From: Jaxcoder Date: Mon, 10 Jun 2024 09:02:39 -0400 Subject: [PATCH] add window.ethereum check --- packages/grant-explorer/src/features/api/AlloWrapper.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/grant-explorer/src/features/api/AlloWrapper.tsx b/packages/grant-explorer/src/features/api/AlloWrapper.tsx index 1578331d5..4273f0d50 100644 --- a/packages/grant-explorer/src/features/api/AlloWrapper.tsx +++ b/packages/grant-explorer/src/features/api/AlloWrapper.tsx @@ -19,6 +19,7 @@ function AlloWrapper({ children }: { children: JSX.Element | JSX.Element[] }) { const chainID = chain?.id; const backend = useMemo(() => { + if (!window.ethereum) return null; const web3Provider = new providers.Web3Provider(window.ethereum, chain?.id); const signer = web3Provider.getSigner(address); const chainIdSupported = chainID ? isChainIdSupported(chainID) : false;