From e6981ed0dbee6425ee453e67d8eb1b8759508d7b Mon Sep 17 00:00:00 2001 From: aliel Date: Mon, 16 Sep 2024 22:50:36 +0200 Subject: [PATCH] fix: message state --- src/pages/Chat.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/Chat.vue b/src/pages/Chat.vue index 69680c7..93dbad7 100644 --- a/src/pages/Chat.vue +++ b/src/pages/Chat.vue @@ -267,13 +267,15 @@ async function generatePersonaMessage() { )) { const stopped = output.stopped || shouldStopGeneration.value; let content = output.content; + + // Update the local state include updates + response.content = content; + response.stopped = stopped; + if (stopped) { shouldStopGeneration.value = false; break; } - // Update the local state include updates - response.content = content; - response.stopped = stopped; chatRef.value.messages = [...chatRef.value.messages]; // Scroll to the bottom of the chat