From 1d3fd8d47c3e7212e83740cc86c33751e7dafb5b Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Wed, 7 Jan 2026 18:34:51 +0200 Subject: [PATCH] remove redundant comments --- surfsense_web/app/dashboard/page.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/surfsense_web/app/dashboard/page.tsx b/surfsense_web/app/dashboard/page.tsx index 22a2307f9..fbf567cba 100644 --- a/surfsense_web/app/dashboard/page.tsx +++ b/surfsense_web/app/dashboard/page.tsx @@ -177,10 +177,10 @@ const DashboardPage = () => { // Auto-redirect to chat for users with exactly 1 search space, or auto-create if none useEffect(() => { const handleAutoRedirect = async () => { - // Don't run if still loading or already attempted + if (loading || hasAttemptedAutoCreate.current) return; - // If user has exactly 1 search space, redirect to its chat + if (searchSpaces.length === 1) { router.replace(`/dashboard/${searchSpaces[0].id}/new-chat`); return; @@ -190,8 +190,7 @@ const DashboardPage = () => { return; } - // If no search spaces exist (edge case for users who registered before this feature), - // auto-create one and redirect + hasAttemptedAutoCreate.current = true; setIsAutoCreating(true);