We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fce82d5 commit f18e56dCopy full SHA for f18e56d
frontend/src/pages/public/ErrorPage/ErrorPage.tsx
@@ -16,13 +16,17 @@ export const ErrorPage = ({ error }: ErrorComponentProps) => {
16
const reloadCount = parseInt(sessionStorage.getItem("vitePreloadErrorCount") || "0", 10);
17
18
useEffect(() => {
19
+ let timeout: NodeJS.Timeout | null = null;
20
if (isDeploymentSkew && reloadCount <= 3) {
- const timeout = setTimeout(() => {
21
- clearTimeout(timeout);
+ timeout = setTimeout(() => {
22
+ if (timeout) clearTimeout(timeout);
23
sessionStorage.setItem("vitePreloadErrorCount", (reloadCount + 1).toString());
24
window.location.reload();
25
}, 10000);
26
}
27
+ return () => {
28
29
+ };
30
}, [isDeploymentSkew]);
31
32
if (
0 commit comments