SurfSense/surfsense_web/lib/onboarding.ts
Anish Sarkar 901c72cdcc feat(onboarding): implement onboarding completion check utility
- Added a new utility function `isLlmOnboardingComplete` to determine if the onboarding process is complete based on the agent LLM ID and the presence of global configurations.
- Updated the onboarding logic in the `OnboardPage` and `DashboardClientLayout` components to utilize the new utility function for improved readability and maintainability.
2026-06-07 17:53:18 +05:30

8 lines
253 B
TypeScript

export function isLlmOnboardingComplete(
agentLlmId: number | null | undefined,
hasGlobalConfigs: boolean
): boolean {
if (agentLlmId === null || agentLlmId === undefined) return false;
if (agentLlmId === 0) return hasGlobalConfigs;
return true;
}