diff --git a/src/components/ConnectionRequired.tsx b/src/components/ConnectionRequired.tsx index 82371fe85..2a86c7df7 100644 --- a/src/components/ConnectionRequired.tsx +++ b/src/components/ConnectionRequired.tsx @@ -146,12 +146,14 @@ const ConnectionRequired: FunctionComponent = ({ setIsLoading(false); }; - loading.show(); validateConnection(); }, [ isAdminRequired, isUserRequired, navigate ]); + // Show/hide the loading indicator useEffect(() => { - if (!isLoading) { + if (isLoading) { + loading.show(); + } else { loading.hide(); } }, [ isLoading ]);