only hit /nudges after onboarding
This commit is contained in:
parent
5a7d299a9b
commit
1d53ce26d2
1 changed files with 8 additions and 0 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue