refac
This commit is contained in:
1 parent
7be009649a
commit
388f62f8a0
1 file changed
+6
-5
@@ -555,6 +555,10 @@
|
|||||||
}
|
}
|
||||||
} else if (type === 'context_compaction') {
|
} else if (type === 'context_compaction') {
|
||||||
handleContextCompactionStatus(data);
|
handleContextCompactionStatus(data);
|
||||||
|
} else if (type === 'chat:active') {
|
||||||
|
if (!data?.active) {
|
||||||
|
taskIds = null;
|
||||||
|
}
|
||||||
} else if (type === 'chat:completion') {
|
} else if (type === 'chat:completion') {
|
||||||
chatCompletionEventHandler(data, message, event.chat_id);
|
chatCompletionEventHandler(data, message, event.chat_id);
|
||||||
} else if (type === 'chat:tasks:cancel') {
|
} else if (type === 'chat:tasks:cancel') {
|
||||||
@@ -1614,7 +1618,6 @@
|
|||||||
currentChatPage.set(1);
|
currentChatPage.set(1);
|
||||||
await chats.set(await getChatList(localStorage.token, $currentChatPage));
|
await chats.set(await getChatList(localStorage.token, $currentChatPage));
|
||||||
}
|
}
|
||||||
taskIds = null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
|
const chatActionHandler = async (_chatId, actionId, modelId, responseMessageId, event = null) => {
|
||||||
@@ -2584,10 +2587,8 @@
|
|||||||
} else {
|
} else {
|
||||||
// Backend returns task_ids (multi-model) or task_id (single model)
|
// Backend returns task_ids (multi-model) or task_id (single model)
|
||||||
const newTaskIds = res.task_ids ?? (res.task_id ? [res.task_id] : []);
|
const newTaskIds = res.task_ids ?? (res.task_id ? [res.task_id] : []);
|
||||||
if (taskIds) {
|
if (newTaskIds.length > 0) {
|
||||||
taskIds.push(...newTaskIds);
|
taskIds = [...(taskIds ?? []), ...newTaskIds];
|
||||||
} else {
|
|
||||||
taskIds = newTaskIds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backend returns chat_id for new chats — set store + URL.
|
// Backend returns chat_id for new chats — set store + URL.
|
||||||
|
|||||||
Reference in new issue
Block a user