fix: load messages on mount to prevent empty chat and sync valid task persistence types
This commit is contained in:
@@ -16,6 +16,8 @@ export interface Task {
|
|||||||
status: TaskStatus
|
status: TaskStatus
|
||||||
timestamp: number
|
timestamp: number
|
||||||
messageIds?: string[] // IDs of messages associated with this task
|
messageIds?: string[] // IDs of messages associated with this task
|
||||||
|
taskSessionId?: string
|
||||||
|
archived?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SessionTasks {
|
export interface SessionTasks {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
import { createSignal, Show, onMount, For, onCleanup, batch } from "solid-js";
|
import { createSignal, Show, onMount, For, onCleanup, batch } from "solid-js";
|
||||||
import toast from "solid-toast";
|
import toast from "solid-toast";
|
||||||
import { sessions, activeSessionId, setActiveSession } from "@/stores/session-state";
|
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 { addTask, setActiveTask, archiveTask } from "@/stores/task-actions";
|
||||||
import { messageStoreBus } from "@/stores/message-v2/bus";
|
import { messageStoreBus } from "@/stores/message-v2/bus";
|
||||||
import { formatTokenTotal } from "@/lib/formatters";
|
import { formatTokenTotal } from "@/lib/formatters";
|
||||||
@@ -216,6 +216,9 @@ export default function MultiXV2(props: MultiXV2Props) {
|
|||||||
setSendingTasks(new Set<string>());
|
setSendingTasks(new Set<string>());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Initialize
|
||||||
|
loadMessages(props.instanceId, props.sessionId);
|
||||||
|
fetchSessions(props.instanceId);
|
||||||
syncFromStore();
|
syncFromStore();
|
||||||
|
|
||||||
const interval = setInterval(syncFromStore, 150);
|
const interval = setInterval(syncFromStore, 150);
|
||||||
|
|||||||
Reference in New Issue
Block a user