mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-30 00:32:30 +08:00
Fix: If there is an error message on the chat page, the subsequent message references will not display correctly. #12252 (#12283)
### What problem does this PR solve? Fix: If there is an error message on the chat page, the subsequent message references will not display correctly. #12252 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -213,7 +213,7 @@ const MarkdownContent = ({
|
||||
return (
|
||||
<HoverCard key={i}>
|
||||
<HoverCardTrigger>
|
||||
<span className="text-text-secondary bg-bg-card rounded-2xl px-1 mx-1">
|
||||
<span className="text-text-secondary bg-bg-card rounded-2xl px-1 mx-1 text-nowrap">
|
||||
Fig. {chunkIndex + 1}
|
||||
</span>
|
||||
</HoverCardTrigger>
|
||||
|
||||
@ -32,7 +32,10 @@ export const buildMessageItemReference = (
|
||||
message: IMessage,
|
||||
) => {
|
||||
const assistantMessages = conversation.message
|
||||
?.filter((x) => x.role === MessageType.Assistant)
|
||||
?.filter(
|
||||
(x) =>
|
||||
x.role === MessageType.Assistant && !x.content.startsWith('**ERROR**:'), // Exclude error messages
|
||||
)
|
||||
.slice(1);
|
||||
const referenceIndex = assistantMessages.findIndex(
|
||||
(x) => x.id === message.id,
|
||||
|
||||
Reference in New Issue
Block a user