From aca243ba43f8159d622ce03754ef713ca165eec6 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Sun, 12 Jul 2026 20:30:23 +0530 Subject: [PATCH] refactor(onboarding): remove client-side onboarding helper --- surfsense_web/lib/onboarding.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 surfsense_web/lib/onboarding.ts diff --git a/surfsense_web/lib/onboarding.ts b/surfsense_web/lib/onboarding.ts deleted file mode 100644 index 6ffb75662..000000000 --- a/surfsense_web/lib/onboarding.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { ConnectionRead } from "@/contracts/types/model-connections.types"; - -export function hasEnabledChatModel(connections: ConnectionRead[]): boolean { - return connections.some( - (connection) => - connection.enabled && - connection.models.some((model) => model.enabled && Boolean(model.supports_chat)) - ); -} - -export function isLlmOnboardingComplete( - chatModelId: number | null | undefined, - globalConnections: ConnectionRead[], - workspaceConnections: ConnectionRead[] -): boolean { - const connections = [...globalConnections, ...workspaceConnections]; - const resolvedChatModelId = chatModelId ?? 0; - - if (resolvedChatModelId === 0) { - return hasEnabledChatModel(connections); - } - - return connections.some((connection) => - connection.models.some( - (model) => model.id === resolvedChatModelId && model.enabled && Boolean(model.supports_chat) - ) - ); -}