mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-01 20:03:30 +02:00
chore: recurse
This commit is contained in:
parent
f0a6c348d1
commit
7de87ada81
2 changed files with 12 additions and 11 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,11 @@ 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
|
);
|
||||||
);
|
|
||||||
}, [preferences]);
|
}, [preferences]);
|
||||||
|
|
||||||
const [isAutoConfiguring, setIsAutoConfiguring] = useState(false);
|
const [isAutoConfiguring, setIsAutoConfiguring] = useState(false);
|
||||||
|
|
@ -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}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue