From 51b594036d028adf62573aa825473fd10286d7af Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Tue, 20 Feb 2024 15:27:47 -0800 Subject: [PATCH] invoke stopResponse() if user deletes message during response generation --- src/lib/components/chat/Messages.svelte | 2 ++ src/routes/(app)/+page.svelte | 1 + src/routes/(app)/c/[id]/+page.svelte | 1 + 3 files changed, 4 insertions(+) diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index a4a5ffa2..9efab1e5 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -16,6 +16,7 @@ export let sendPrompt: Function; export let continueGeneration: Function; export let regenerateResponse: Function; + export let stopResponse: Function; export let processing = ''; export let bottomPadding = false; @@ -228,6 +229,7 @@ await updateChatById(localStorage.token, chatId, { history }); await chats.set(await getChatList(localStorage.token)); + stopResponse(); }; diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 33409ec3..b93dc860 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -828,6 +828,7 @@ {sendPrompt} {continueGeneration} {regenerateResponse} + {stopResponse} /> diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index be84467d..737a13e0 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -858,6 +858,7 @@ {sendPrompt} {continueGeneration} {regenerateResponse} + {stopResponse} />