diff --git a/src/views/HomeView.tsx b/src/views/HomeView.tsx index 8b67ba1bf8..1f68250f7d 100644 --- a/src/views/HomeView.tsx +++ b/src/views/HomeView.tsx @@ -12,7 +12,7 @@ export const HomeView: React.FC = () => { const clearMessageFuncRef = useRef(undefined as any); useEffect(() => { - let maxNumberOfRetries = 1; + const maxNumberOfRetries = 1; let retries = 0; const publishDocumentation = async () => { @@ -29,22 +29,22 @@ export const HomeView: React.FC = () => { window.open(url); } catch (error) { if (retries < maxNumberOfRetries) { - console.log("Retrying...") + console.log("Retrying..."); retries++; - publishDocumentation() + publishDocumentation(); } else { setIsPublishing(false); - setHasErrorOnPublishing(true) + setHasErrorOnPublishing(true); clearMessageFuncRef.current = setTimeout(() => { - setHasErrorOnPublishing(false) + setHasErrorOnPublishing(false); }, 5000); } } - } + }; if (isPublishing) { - setHasErrorOnPublishing(false) + setHasErrorOnPublishing(false); publishDocumentation(); } }, [isPublishing, htmlDocumentation]); @@ -121,10 +121,11 @@ export const HomeView: React.FC = () => { )} - {hasErrorOnPublishing && + {hasErrorOnPublishing && (
-
} + + )} )} @@ -152,7 +153,13 @@ export const PublishButton: React.FC = ({ {!isPublishing && "Publish"} {isPublishing && ( -
+