Fix loading indicator showing when loaded

This commit is contained in:
Bill Thornton 2022-09-02 14:11:19 -04:00
parent e2b951e25d
commit 0783c0eb10

View file

@ -146,12 +146,14 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
setIsLoading(false); setIsLoading(false);
}; };
loading.show();
validateConnection(); validateConnection();
}, [ isAdminRequired, isUserRequired, navigate ]); }, [ isAdminRequired, isUserRequired, navigate ]);
// Show/hide the loading indicator
useEffect(() => { useEffect(() => {
if (!isLoading) { if (isLoading) {
loading.show();
} else {
loading.hide(); loading.hide();
} }
}, [ isLoading ]); }, [ isLoading ]);