refac
This commit is contained in:
1 parent
d6cda4a04b
commit
2856def6c0
1 file changed
+4
@@ -1591,9 +1591,13 @@
|
|||||||
// Reconcile active tasks with message state:
|
// Reconcile active tasks with message state:
|
||||||
// If the response is already done, remaining tasks are just background
|
// If the response is already done, remaining tasks are just background
|
||||||
// work (follow-ups, title gen) that shouldn't block the input.
|
// work (follow-ups, title gen) that shouldn't block the input.
|
||||||
|
const activeTaskIds = taskIds;
|
||||||
const pendingTaskIds = await getTaskIdsByChatId(localStorage.token, $chatId)
|
const pendingTaskIds = await getTaskIdsByChatId(localStorage.token, $chatId)
|
||||||
.then((res) => res?.task_ids ?? [])
|
.then((res) => res?.task_ids ?? [])
|
||||||
.catch(() => []);
|
.catch(() => []);
|
||||||
|
if (taskIds !== activeTaskIds) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const currentMessage = history.currentId ? history.messages[history.currentId] : null;
|
const currentMessage = history.currentId ? history.messages[history.currentId] : null;
|
||||||
const responseComplete = currentMessage?.role === 'assistant' && currentMessage?.done;
|
const responseComplete = currentMessage?.role === 'assistant' && currentMessage?.done;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user