File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
ui/packages/platform/src/pages/Bot/Messages Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,14 @@ type BaseMessageProps = {
22
22
formattedTime ?: string ;
23
23
aiModel ?: string
24
24
stateMessage ?: StateMessage | null
25
+ isCurrentStreamMessage ?: boolean
25
26
}
26
27
27
28
type AiMessageProps = BaseMessageProps & {
28
29
isAi : true ;
29
30
content : string ;
30
31
aiModel : string
32
+ isCurrentStreamMessage ?: boolean
31
33
}
32
34
33
35
type HumanMessageProps = BaseMessageProps & {
@@ -256,7 +258,8 @@ export const Message = React.memo((props: MessageProps) => {
256
258
created_at,
257
259
isLoading,
258
260
aiModel,
259
- stateMessage
261
+ stateMessage,
262
+ isCurrentStreamMessage
260
263
} = props ;
261
264
262
265
const [ isDebugVisible , setDebugVisible ] = useState ( false ) ;
@@ -280,7 +283,7 @@ export const Message = React.memo((props: MessageProps) => {
280
283
if ( ! inline ) {
281
284
return (
282
285
< >
283
- { matchMermaid && < MermaidDiagram chart = { String ( children ) . replace ( / \n $ / , '' ) } /> }
286
+ { matchMermaid && ! isCurrentStreamMessage && < MermaidDiagram chart = { String ( children ) . replace ( / \n $ / , '' ) } /> }
284
287
< CodeBlock value = { String ( children ) . replace ( / \n $ / , '' ) } language = { match ?. [ 1 ] } />
285
288
</ >
286
289
)
Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ export const Messages = React.memo(() => {
281
281
isAi
282
282
content = { currentStreamMessage . content }
283
283
aiModel = { currentStreamMessage . ai_model }
284
+ isCurrentStreamMessage
284
285
/>
285
286
}
286
287
{ isWaitingForAnswer &&
You can’t perform that action at this time.
0 commit comments