Skip to content

Commit 4479ef2

Browse files
committed
fix: remove optimistic code block capture as it is already there
1 parent e52b6d1 commit 4479ef2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/components/Message/hooks/useMessageTextStreaming.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ export const useMessageTextStreaming = <
4040
const newCursorValue = textCursor.current + renderingLetterCount;
4141
const newText = text.substring(0, newCursorValue);
4242
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);
43+
setStreamedMessageText(newText);
4644
}, streamingLetterIntervalMs);
4745

4846
return () => {

0 commit comments

Comments
 (0)