From b8337db9d5ee42bf0894c020cbcc459e67a055c5 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 17 Jan 2024 19:31:55 -0800 Subject: [PATCH] Update +page.svelte --- src/routes/(app)/c/[id]/+page.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index bb33aa80..9a073935 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -26,6 +26,8 @@ let autoScroll = true; let processing = ''; + let currentRequestId = null; + // let chatId = $page.params.id; let selectedModels = ['']; let selectedModelfile = null; @@ -338,7 +340,10 @@ if (stopResponseFlag) { controller.abort('User: Stop Response'); + await cancelChatCompletion(localStorage.token, currentRequestId); } + + currentRequestId = null; break; } @@ -356,6 +361,7 @@ if ('id' in data) { console.log(data); + currentRequestId = data.id; } else { if (data.done == false) { if (responseMessage.content == '' && data.message.content == '\n') {