This commit is contained in:
CREDO23 2025-12-11 12:33:09 +02:00
parent 3e8cdabd73
commit be381c833e
4 changed files with 6 additions and 13 deletions

View file

@ -60,10 +60,8 @@ export function DashboardClientLayout({
} }
}, [activeChatId, isChatPannelOpen]); }, [activeChatId, isChatPannelOpen]);
// Replace useLLMPreferences with jotai atom
const { data: preferences = {}, isFetching: loading, error } = useAtomValue(llmPreferencesAtom); const { data: preferences = {}, isFetching: loading, error } = useAtomValue(llmPreferencesAtom);
// Create isOnboardingComplete function for backward compatibility
const isOnboardingComplete = useCallback(() => { const isOnboardingComplete = useCallback(() => {
return !!( return !!(
preferences.long_context_llm_id && preferences.long_context_llm_id &&

View file

@ -121,7 +121,7 @@ const OnboardPage = () => {
strategic_llm_id: defaultConfigId, strategic_llm_id: defaultConfigId,
}; };
try {
await updatePreferences({ await updatePreferences({
search_space_id: searchSpaceId, search_space_id: searchSpaceId,
data: newPreferences data: newPreferences
@ -131,9 +131,6 @@ const OnboardPage = () => {
toast.success("AI models configured automatically!", { toast.success("AI models configured automatically!", {
description: "You can customize these in advanced settings.", description: "You can customize these in advanced settings.",
}); });
} catch (updateError) {
console.error("Failed to update preferences:", updateError);
}
} catch (error) { } catch (error) {
console.error("Auto-configuration failed:", error); console.error("Auto-configuration failed:", error);
} finally { } finally {

View file

@ -99,8 +99,6 @@ export function SetupLLMStep({
const { mutateAsync : deleteLLMConfig } = useAtomValue(deleteLLMConfigMutationAtom); const { mutateAsync : deleteLLMConfig } = useAtomValue(deleteLLMConfigMutationAtom);
const { data : llmConfigs = []} = useAtomValue(llmConfigsAtom); const { data : llmConfigs = []} = useAtomValue(llmConfigsAtom);
const { data: globalConfigs = [] } = useAtomValue(globalLLMConfigsAtom); const { data: globalConfigs = [] } = useAtomValue(globalLLMConfigsAtom);
// Replace useLLMPreferences with jotai atoms
const { data: preferences = {} } = useAtomValue(llmPreferencesAtom); const { data: preferences = {} } = useAtomValue(llmPreferencesAtom);
const { mutateAsync: updatePreferences } = useAtomValue(updateLLMPreferencesMutationAtom); const { mutateAsync: updatePreferences } = useAtomValue(updateLLMPreferencesMutationAtom);

View file

@ -67,13 +67,13 @@ export function LLMRoleManager({ searchSpaceId }: LLMRoleManagerProps) {
const { const {
data: llmConfigs = [], data: llmConfigs = [],
isFetching: configsLoading, isFetching: configsLoading,
isError: configsError, error: configsError,
refetch: refreshConfigs refetch: refreshConfigs
} = useAtomValue(llmConfigsAtom); } = useAtomValue(llmConfigsAtom);
const { const {
data: globalConfigs = [], data: globalConfigs = [],
isFetching: globalConfigsLoading, isFetching: globalConfigsLoading,
isError: globalConfigsError, error: globalConfigsError,
refetch: refreshGlobalConfigs, refetch: refreshGlobalConfigs,
} = useAtomValue(globalLLMConfigsAtom); } = useAtomValue(globalLLMConfigsAtom);
const { const {
@ -235,9 +235,9 @@ export function LLMRoleManager({ searchSpaceId }: LLMRoleManagerProps) {
<Alert variant="destructive"> <Alert variant="destructive">
<AlertCircle className="h-4 w-4" /> <AlertCircle className="h-4 w-4" />
<AlertDescription> <AlertDescription>
{(configsError && "Failed to load LLM configurations") || {(configsError?.message ?? "Failed to load LLM configurations") ||
(preferencesError && "Failed to load preferences") || (preferencesError?.message ?? "Failed to load preferences") ||
(globalConfigsError && "Failed to load global configurations")} (globalConfigsError?.message ?? "Failed to load global configurations")}
</AlertDescription> </AlertDescription>
</Alert> </Alert>
)} )}