From 0783c0eb10e1a17c04593e37856b5949e9d57b07 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 2 Sep 2022 14:11:19 -0400 Subject: [PATCH] Fix loading indicator showing when loaded --- src/components/ConnectionRequired.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/ConnectionRequired.tsx b/src/components/ConnectionRequired.tsx index 82371fe853..2a86c7df77 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 ]);