Skip to content

Commit

Permalink
fix: Fix simulate streaming of messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Nov 24, 2024
1 parent f5ddcf2 commit acc8eca
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hooks/internal/useMessagesInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export const useMessagesInternal = () => {
}
let streamIndex = 0;
const endStreamIndex = streamMessage.length;
message.content = "";

const simStreamDoneTask: Promise<void> = new Promise(resolve => {
const intervalId = setInterval(() => {
Expand All @@ -89,8 +88,8 @@ export const useMessagesInternal = () => {
if (updatedMessages[i].id === placeholderMessage.id) {
const character = streamMessage[streamIndex];
if (character) {
message.content += character;
updatedMessages[i] = message;
placeholderMessage.content += character;
updatedMessages[i] = placeholderMessage;
}
streamIndex++;
break;
Expand Down

0 comments on commit acc8eca

Please sign in to comment.