Skip to content

Commit 730e52a

Browse files
committed
refac
1 parent 8c2afb8 commit 730e52a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/lib/components/chat/Chat.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,7 @@
24172417
history.messages[responseMessage.id] = responseMessage;
24182418
};
24192419
2420-
const stopResponse = async () => {
2420+
const stopResponse = async (processQueue = true) => {
24212421
if (taskIds) {
24222422
for (const taskId of taskIds) {
24232423
const res = await stopTask(localStorage.token, taskId).catch((error) => {
@@ -2449,7 +2449,9 @@
24492449
generationController = null;
24502450
}
24512451
2452-
await processNextInQueue($chatId);
2452+
if (processQueue) {
2453+
await processNextInQueue($chatId);
2454+
}
24532455
};
24542456
24552457
const submitMessage = async (parentId, prompt) => {
@@ -2913,10 +2915,8 @@
29132915
...q,
29142916
[$chatId]: queue.filter((m) => m.id !== id)
29152917
}));
2916-
// Stop current generation first
2917-
await stopResponse();
2918+
await stopResponse(false);
29182919
await tick();
2919-
// Submit queued message directly without clearing input
29202920
await submitPrompt(item.prompt, item.files);
29212921
}
29222922
}}

0 commit comments

Comments
 (0)