From dd47b574b3ee897e463b700baffb7c2c3a408512 Mon Sep 17 00:00:00 2001 From: Allen Zhou <46854522+allenzhou101@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:02:12 -0800 Subject: [PATCH] Update useConnection.ts --- client/src/lib/hooks/useConnection.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/lib/hooks/useConnection.ts b/client/src/lib/hooks/useConnection.ts index 0e843b8..7225184 100644 --- a/client/src/lib/hooks/useConnection.ts +++ b/client/src/lib/hooks/useConnection.ts @@ -225,7 +225,12 @@ export function useConnection({ if (shouldRetry) { return connect(undefined, retryCount + 1); } - return; + + if (error instanceof SseError && error.code === 401) { + // Don't set error state if we're about to redirect for auth + return; + } + throw error; } const capabilities = client.getServerCapabilities();