mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +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:
@ -2,7 +2,6 @@ import { useDeleteMessage, useFeedback } from '@/hooks/chat-hooks';
|
||||
import { useSetModalState } from '@/hooks/common-hooks';
|
||||
import { IRemoveMessageById, useSpeechWithSse } from '@/hooks/logic-hooks';
|
||||
import { IFeedbackRequestBody } from '@/interfaces/request/chat';
|
||||
import { getMessagePureId } from '@/utils/chat';
|
||||
import { hexStringToUint8Array } from '@/utils/common-util';
|
||||
import { SpeechPlayer } from 'openai-speech-stream-player';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
@ -15,7 +14,7 @@ export const useSendFeedback = (messageId: string) => {
|
||||
async (params: IFeedbackRequestBody) => {
|
||||
const ret = await feedback({
|
||||
...params,
|
||||
messageId: getMessagePureId(messageId),
|
||||
messageId: messageId,
|
||||
});
|
||||
|
||||
if (ret === 0) {
|
||||
@ -41,9 +40,8 @@ export const useRemoveMessage = (
|
||||
const { deleteMessage, loading } = useDeleteMessage();
|
||||
|
||||
const onRemoveMessage = useCallback(async () => {
|
||||
const pureId = getMessagePureId(messageId);
|
||||
if (pureId) {
|
||||
const code = await deleteMessage(pureId);
|
||||
if (messageId) {
|
||||
const code = await deleteMessage(messageId);
|
||||
if (code === 0) {
|
||||
removeMessageById?.(messageId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user