chore: recurse

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2025-12-14 22:32:13 -08:00
parent f0a6c348d1
commit 7de87ada81
2 changed files with 12 additions and 11 deletions

View file

@ -191,7 +191,9 @@ export function DashboardClientLayout({
<CardDescription>{t("failed_load_llm_config")}</CardDescription> <CardDescription>{t("failed_load_llm_config")}</CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<p className="text-sm text-muted-foreground">{error.message}</p> <p className="text-sm text-muted-foreground">
{error instanceof Error ? error.message : String(error)}
</p>
</CardContent> </CardContent>
</Card> </Card>
</div> </div>

View file

@ -43,8 +43,7 @@ const OnboardPage = () => {
// Compute isOnboardingComplete // Compute isOnboardingComplete
const isOnboardingComplete = useMemo(() => { const isOnboardingComplete = useMemo(() => {
return () => return !!(
!!(
preferences.long_context_llm_id && preferences.long_context_llm_id &&
preferences.fast_llm_id && preferences.fast_llm_id &&
preferences.strategic_llm_id preferences.strategic_llm_id
@ -85,7 +84,7 @@ const OnboardPage = () => {
!configsLoading && !configsLoading &&
!globalConfigsLoading !globalConfigsLoading
) { ) {
wasCompleteOnMount.current = isOnboardingComplete(); wasCompleteOnMount.current = isOnboardingComplete;
hasCheckedInitialState.current = true; hasCheckedInitialState.current = true;
} }
}, [preferencesLoading, configsLoading, globalConfigsLoading, isOnboardingComplete]); }, [preferencesLoading, configsLoading, globalConfigsLoading, isOnboardingComplete]);
@ -109,7 +108,7 @@ const OnboardPage = () => {
const autoConfigureLLMs = useCallback(async () => { const autoConfigureLLMs = useCallback(async () => {
if (hasAttemptedAutoConfig.current) return; if (hasAttemptedAutoConfig.current) return;
if (globalConfigs.length === 0) return; if (globalConfigs.length === 0) return;
if (isOnboardingComplete()) { if (isOnboardingComplete) {
setAutoConfigComplete(true); setAutoConfigComplete(true);
return; return;
} }
@ -158,7 +157,7 @@ const OnboardPage = () => {
}, [configsLoading, globalConfigsLoading, preferencesLoading, autoConfigureLLMs]); }, [configsLoading, globalConfigsLoading, preferencesLoading, autoConfigureLLMs]);
const allConfigs = [...globalConfigs, ...llmConfigs]; const allConfigs = [...globalConfigs, ...llmConfigs];
const isReady = autoConfigComplete || isOnboardingComplete(); const isReady = autoConfigComplete || isOnboardingComplete;
// Loading state // Loading state
if (configsLoading || preferencesLoading || globalConfigsLoading || isAutoConfiguring) { if (configsLoading || preferencesLoading || globalConfigsLoading || isAutoConfiguring) {
@ -176,7 +175,7 @@ const OnboardPage = () => {
// Show LLM setup if no configs available OR if roles are not assigned yet // Show LLM setup if no configs available OR if roles are not assigned yet
// This forces users to complete role assignment before seeing the final screen // This forces users to complete role assignment before seeing the final screen
if (allConfigs.length === 0 || !isOnboardingComplete()) { if (allConfigs.length === 0 || !isOnboardingComplete) {
return ( return (
<OnboardLLMSetup <OnboardLLMSetup
searchSpaceId={searchSpaceId} searchSpaceId={searchSpaceId}