-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hi, I am using Frigade in my NextJs project.
I have implemented Frigade in a way that it checks if the user hasn't completed the flow then it will show the frigade and if the user has completed the flow, it will hide the onboarding. In fact, it will unmount the FrigadeProvider component and theoretically speaking there won't be any unnecessary calls from Frigade. However, I can see there are still many calls in Network Tab. See the image below
See the my coding logic for conditional rendering of FrigadeProvider
// ✅ If no user is logged in or onboarding is complete, render app without Frigade
if (!FRIGADE_API_KEY || onboardingComplete) {
const reason = !FRIGADE_API_KEY
? "No Frigade API key available"
: "Onboarding already completed";
console.debug(`Loading app without Frigade: ${reason}`);
return <>{children}</>;
}
// ✅ Wrap app with Frigade provider only when user is logged in and onboarding is not complete
return (
<Frigade.Provider
apiKey={FRIGADE_API_KEY}
css={frigadeCss}
userId={userId || undefined}
theme={frigadeTheme}
>
{children}
</Frigade.Provider>
);
PS: onboardingComplete is true.
Can you please help me out if I'm doing anything wrong here. Thanks
Metadata
Metadata
Assignees
Labels
No labels