mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 15:06:50 +08:00
Fix: In order to distinguish the keys of a pair of messages, add a prefix to the id when rendering the message. #4409 (#4451)
### What problem does this PR solve? Fix: In order to distinguish the keys of a pair of messages, add a prefix to the id when rendering the message. #4409 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -18,6 +18,7 @@ import {
|
||||
useGetChatSearchParams,
|
||||
} from '@/hooks/chat-hooks';
|
||||
import { useFetchUserInfo } from '@/hooks/user-setting-hooks';
|
||||
import { buildMessageUuidWithRole } from '@/utils/chat';
|
||||
import { memo } from 'react';
|
||||
import styles from './index.less';
|
||||
|
||||
@ -64,7 +65,7 @@ const ChatContainer = ({ controller }: IProps) => {
|
||||
sendLoading &&
|
||||
derivedMessages.length - 1 === i
|
||||
}
|
||||
key={message.id}
|
||||
key={buildMessageUuidWithRole(message)}
|
||||
item={message}
|
||||
nickname={userInfo.nickname}
|
||||
avatar={userInfo.avatar}
|
||||
|
||||
@ -14,6 +14,7 @@ import { buildMessageItemReference } from '../utils';
|
||||
import PdfDrawer from '@/components/pdf-drawer';
|
||||
import { useFetchNextConversationSSE } from '@/hooks/chat-hooks';
|
||||
import { useFetchFlowSSE } from '@/hooks/flow-hooks';
|
||||
import { buildMessageUuidWithRole } from '@/utils/chat';
|
||||
import styles from './index.less';
|
||||
|
||||
const ChatContainer = () => {
|
||||
@ -54,7 +55,7 @@ const ChatContainer = () => {
|
||||
{derivedMessages?.map((message, i) => {
|
||||
return (
|
||||
<MessageItem
|
||||
key={message.id}
|
||||
key={buildMessageUuidWithRole(message)}
|
||||
avatardialog={avatarData?.avatar}
|
||||
item={message}
|
||||
nickname="You"
|
||||
|
||||
Reference in New Issue
Block a user