fix: load messages on mount to prevent empty chat and sync valid task persistence types

This commit is contained in:
Gemini AI
2025-12-27 13:02:35 +04:00
Unverified
parent 326825a5fb
commit 802e3ba759
2 changed files with 6 additions and 1 deletions

View File

@@ -16,6 +16,8 @@ export interface Task {
status: TaskStatus
timestamp: number
messageIds?: string[] // IDs of messages associated with this task
taskSessionId?: string
archived?: boolean
}
export interface SessionTasks {

View File

@@ -10,7 +10,7 @@
import { createSignal, Show, onMount, For, onCleanup, batch } from "solid-js";
import toast from "solid-toast";
import { sessions, activeSessionId, setActiveSession } from "@/stores/session-state";
import { sendMessage, compactSession, updateSessionAgent, updateSessionModelForSession, forceReset, abortSession } from "@/stores/session-actions";
import { sendMessage, compactSession, updateSessionAgent, updateSessionModelForSession, forceReset, abortSession, loadMessages, fetchSessions } from "@/stores/session-actions";
import { addTask, setActiveTask, archiveTask } from "@/stores/task-actions";
import { messageStoreBus } from "@/stores/message-v2/bus";
import { formatTokenTotal } from "@/lib/formatters";
@@ -216,6 +216,9 @@ export default function MultiXV2(props: MultiXV2Props) {
setSendingTasks(new Set<string>());
});
// Initialize
loadMessages(props.instanceId, props.sessionId);
fetchSessions(props.instanceId);
syncFromStore();
const interval = setInterval(syncFromStore, 150);