From d41315b8a44b0eb209da21da86b8a1b4e64d721c Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Fri, 3 Oct 2025 01:58:23 -0700 Subject: [PATCH] don't navigate to /login for network errors --- frontend/src/router.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/src/router.tsx b/frontend/src/router.tsx index b06294a4c..a72b99968 100644 --- a/frontend/src/router.tsx +++ b/frontend/src/router.tsx @@ -135,6 +135,20 @@ const RequireAuth = () => { const { data: user, error } = useUser(); const location = useLocation(); + if ( + (error as { error?: TypeError } | undefined)?.error?.message?.startsWith( + "NetworkError" + ) + ) { + // Will just show the spinner without navigate to login, + // which won't help because its not a login issue. + return ( +
+ +
+ ); + } + if (!LOGIN_TOKENS.jwt() || error) { if (location.pathname === "/") { return ; @@ -146,7 +160,7 @@ const RequireAuth = () => { if (!user) { return (
- +
); }