Merge pull request #3865 from thornbill/fix-connection-required-loading

Fix loading indicator showing when loaded
This commit is contained in:
Bill Thornton
2022-09-02 14:28:51 -04:00
committed by GitHub
+4 -2
View File
@@ -146,12 +146,14 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
setIsLoading(false);
};
loading.show();
validateConnection();
}, [ isAdminRequired, isUserRequired, navigate ]);
// Show/hide the loading indicator
useEffect(() => {
if (!isLoading) {
if (isLoading) {
loading.show();
} else {
loading.hide();
}
}, [ isLoading ]);