Skip to content

Commit 13d7ef2

Browse files
committed
update stream
1 parent 0350329 commit 13d7ef2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/Chat/Chat.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export const Chat = memo(({stopConversationRef}: Props) => {
142142
const decoder = new TextDecoder();
143143
let done = false;
144144
let isFirst = true;
145+
let isShowFirst = true;
145146
let queue: any[] = [];
146147
let text = '';
147148
while (!done || queue.length !== 0) {
@@ -178,7 +179,11 @@ export const Chat = memo(({stopConversationRef}: Props) => {
178179

179180
for (const item of queue) {
180181
const thisWord = queue.shift();
181-
await delay(Math.random() * 200);
182+
if(!isShowFirst){
183+
await delay(Math.random() * 500);
184+
}else {
185+
isShowFirst = false;
186+
}
182187
text += thisWord
183188
if (isFirst) {
184189
isFirst = false;

0 commit comments

Comments
 (0)