From 1d53ce26d2c853d55db231a2c50e3c6cfa1b2bef Mon Sep 17 00:00:00 2001 From: phact Date: Fri, 24 Oct 2025 02:14:02 -0400 Subject: [PATCH] only hit /nudges after onboarding --- frontend/src/app/chat/page.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/app/chat/page.tsx b/frontend/src/app/chat/page.tsx index dc85f43e..29f56d49 100644 --- a/frontend/src/app/chat/page.tsx +++ b/frontend/src/app/chat/page.tsx @@ -698,8 +698,16 @@ function ChatPage() { }; }, [endpoint, setPreviousResponseIds, setLoading]); + // Check if onboarding is complete by looking at local storage + const isOnboardingComplete = + typeof window !== "undefined" && + localStorage.getItem("onboarding-step") === null; + const { data: nudges = [], cancel: cancelNudges } = useGetNudgesQuery( previousResponseIds[endpoint], + { + enabled: isOnboardingComplete, // Only fetch nudges after onboarding is complete + }, ); const handleSSEStream = async (userMessage: Message) => {