From b59206a6eb5ed626ed8a4a2d44868e67847ef22f Mon Sep 17 00:00:00 2001 From: Ezerous Date: Thu, 19 Nov 2020 13:43:46 +0200 Subject: [PATCH] Detect if MetaMask exists before proceeding --- .../src/components/LoadingContainer.jsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/concordia-app/src/components/LoadingContainer.jsx b/packages/concordia-app/src/components/LoadingContainer.jsx index 6add0ba..ec25a67 100644 --- a/packages/concordia-app/src/components/LoadingContainer.jsx +++ b/packages/concordia-app/src/components/LoadingContainer.jsx @@ -19,8 +19,19 @@ const LoadingContainer = ({ children }) => { const contractDeployed = useSelector((state) => state.contracts.Forum.deployed); const userFetched = useSelector((state) => state.user.address); - if ((web3Status === 'initializing' || !web3NetworkId) - && !web3NetworkFailed) { + if (!window.ethereum) { + return ( + MetaMask, ' first.']} + imageType="ethereum" + progress={10} + progressType="indicating" + /> + ); + } + + if ((web3Status === 'initializing' || !web3NetworkId) && !web3NetworkFailed) { return ( { ); } - if (initializing - || (!failed && !contractInitialized && contractDeployed)) { + if (initializing || (!failed && !contractInitialized && contractDeployed)) { return (