From 03e60e46f396da79e1bbb98b1ea7a6e84e805906 Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 22 May 2026 14:50:38 +0500 Subject: [PATCH] fix(auth): defer setState in OAuth error effect to avoid cascading renders --- client/src/pages/auth/ui/AuthPage.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/pages/auth/ui/AuthPage.tsx b/client/src/pages/auth/ui/AuthPage.tsx index 12739bd..aeeed89 100644 --- a/client/src/pages/auth/ui/AuthPage.tsx +++ b/client/src/pages/auth/ui/AuthPage.tsx @@ -32,9 +32,12 @@ export function AuthPage() { useEffect(() => { const err = searchParams.get('oauthError') if (!err) return - setOauthError(err) - setSearchParams({}, { replace: true }) - }, [searchParams, setSearchParams]) + const timeoutId = setTimeout(() => { + setOauthError(err) + setSearchParams({}, { replace: true }) + }, 0) + return () => clearTimeout(timeoutId) + }, []) if (showForgot) { return (