mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-02 02:25:31 +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 (
|
return (
|
||||||
<HoverCard key={i}>
|
<HoverCard key={i}>
|
||||||
<HoverCardTrigger>
|
<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}
|
Fig. {chunkIndex + 1}
|
||||||
</span>
|
</span>
|
||||||
</HoverCardTrigger>
|
</HoverCardTrigger>
|
||||||
|
|||||||
@ -32,7 +32,10 @@ export const buildMessageItemReference = (
|
|||||||
message: IMessage,
|
message: IMessage,
|
||||||
) => {
|
) => {
|
||||||
const assistantMessages = conversation.message
|
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);
|
.slice(1);
|
||||||
const referenceIndex = assistantMessages.findIndex(
|
const referenceIndex = assistantMessages.findIndex(
|
||||||
(x) => x.id === message.id,
|
(x) => x.id === message.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user