Skip to content

Commit 2eea22d

Browse files
committed
Render MessageReasoning only if text is present
Updated the condition to render the MessageReasoning component only when the part type is 'reasoning' and part.text exists. This prevents rendering empty reasoning components.
1 parent fea44dd commit 2eea22d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/message.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const PurePreviewMessage = ({
103103
const { type } = part;
104104
const key = `message-${message.id}-part-${index}`;
105105

106-
if (type === 'reasoning') {
106+
if (type === 'reasoning' && part.text) {
107107
return (
108108
<MessageReasoning
109109
key={key}

0 commit comments

Comments
 (0)