Skip to content

Commit

Permalink
fix: message state
Browse files Browse the repository at this point in the history
  • Loading branch information
aliel committed Sep 16, 2024
1 parent f62b441 commit e6981ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6981ed

Please sign in to comment.