From 730e52a431d157dc62d72260668087437f1d52f4 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 2 Apr 2026 19:29:23 -0500 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 820474a94..381d26cd5 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2417,7 +2417,7 @@ history.messages[responseMessage.id] = responseMessage; }; - const stopResponse = async () => { + const stopResponse = async (processQueue = true) => { if (taskIds) { for (const taskId of taskIds) { const res = await stopTask(localStorage.token, taskId).catch((error) => { @@ -2449,7 +2449,9 @@ generationController = null; } - await processNextInQueue($chatId); + if (processQueue) { + await processNextInQueue($chatId); + } }; const submitMessage = async (parentId, prompt) => { @@ -2913,10 +2915,8 @@ ...q, [$chatId]: queue.filter((m) => m.id !== id) })); - // Stop current generation first - await stopResponse(); + await stopResponse(false); await tick(); - // Submit queued message directly without clearing input await submitPrompt(item.prompt, item.files); } }}