We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e52b6d1 commit 4479ef2Copy full SHA for 4479ef2
src/components/Message/hooks/useMessageTextStreaming.ts
@@ -40,9 +40,7 @@ export const useMessageTextStreaming = <
40
const newCursorValue = textCursor.current + renderingLetterCount;
41
const newText = text.substring(0, newCursorValue);
42
textCursor.current += newText.length - textCursor.current;
43
- const codeBlockCounts = (newText.match(/```/g) || []).length;
44
- const shouldOptimisticallyCloseCodeBlock = codeBlockCounts > 0 && codeBlockCounts % 2 > 0;
45
- setStreamedMessageText(shouldOptimisticallyCloseCodeBlock ? newText + '```' : newText);
+ setStreamedMessageText(newText);
46
}, streamingLetterIntervalMs);
47
48
return () => {
0 commit comments