diff --git a/client/src/pages/admin-achievements.tsx b/client/src/pages/admin-achievements.tsx index e18d485..c54c0f3 100644 --- a/client/src/pages/admin-achievements.tsx +++ b/client/src/pages/admin-achievements.tsx @@ -13,9 +13,12 @@ export default function AdminAchievements() { const [, setLocation] = useLocation(); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); const { data: achievements, isLoading } = useQuery({ diff --git a/client/src/pages/admin-aegis.tsx b/client/src/pages/admin-aegis.tsx index 709d3e5..59e9e27 100644 --- a/client/src/pages/admin-aegis.tsx +++ b/client/src/pages/admin-aegis.tsx @@ -13,9 +13,12 @@ export default function AdminAegis() { const queryClient = useQueryClient(); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); const { data: alerts } = useQuery({ diff --git a/client/src/pages/admin-applications.tsx b/client/src/pages/admin-applications.tsx index 4be28ff..e63fede 100644 --- a/client/src/pages/admin-applications.tsx +++ b/client/src/pages/admin-applications.tsx @@ -16,9 +16,12 @@ export default function AdminApplications() { const queryClient = useQueryClient(); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); const { data: applications, isLoading } = useQuery({ diff --git a/client/src/pages/admin-architects.tsx b/client/src/pages/admin-architects.tsx index 8bd7751..ff8d5cc 100644 --- a/client/src/pages/admin-architects.tsx +++ b/client/src/pages/admin-architects.tsx @@ -17,9 +17,12 @@ export default function AdminArchitects() { const queryClient = useQueryClient(); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); const { data: profiles, isLoading } = useQuery({ diff --git a/client/src/pages/admin-credentials.tsx b/client/src/pages/admin-credentials.tsx index 563ba37..42cafda 100644 --- a/client/src/pages/admin-credentials.tsx +++ b/client/src/pages/admin-credentials.tsx @@ -11,9 +11,12 @@ export default function AdminCredentials() { const [, setLocation] = useLocation(); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); if (authLoading || !isAuthenticated) { diff --git a/client/src/pages/admin-logs.tsx b/client/src/pages/admin-logs.tsx index dea3cf7..23ada3c 100644 --- a/client/src/pages/admin-logs.tsx +++ b/client/src/pages/admin-logs.tsx @@ -13,9 +13,12 @@ export default function AdminLogs() { const [, setLocation] = useLocation(); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); const { data: logs, isLoading } = useQuery({ diff --git a/client/src/pages/admin-notifications.tsx b/client/src/pages/admin-notifications.tsx index 8949485..3252f11 100644 --- a/client/src/pages/admin-notifications.tsx +++ b/client/src/pages/admin-notifications.tsx @@ -45,9 +45,12 @@ export default function AdminNotifications() { const [saved, setSaved] = useState(false); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); const toggleSetting = (id: string) => { diff --git a/client/src/pages/admin-projects.tsx b/client/src/pages/admin-projects.tsx index 41bd101..849a11f 100644 --- a/client/src/pages/admin-projects.tsx +++ b/client/src/pages/admin-projects.tsx @@ -13,9 +13,12 @@ export default function AdminProjects() { const [, setLocation] = useLocation(); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); const { data: projects, isLoading } = useQuery({ diff --git a/client/src/pages/admin-sites.tsx b/client/src/pages/admin-sites.tsx index a11a3a9..9adb82b 100644 --- a/client/src/pages/admin-sites.tsx +++ b/client/src/pages/admin-sites.tsx @@ -13,9 +13,12 @@ export default function AdminSites() { const [, setLocation] = useLocation(); useEffect(() => { - if (!authLoading && !isAuthenticated) { - setLocation("/login"); - } + const timer = setTimeout(() => { + if (!authLoading && !isAuthenticated) { + setLocation("/login"); + } + }, 200); + return () => clearTimeout(timer); }, [authLoading, isAuthenticated, setLocation]); const { data: sites, isLoading } = useQuery({