mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Add TagFeatureItem #4368 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -405,30 +405,6 @@ export interface IRemoveMessageById {
|
||||
removeMessageById(messageId: string): void;
|
||||
}
|
||||
|
||||
export const useRemoveMessageById = (
|
||||
setCurrentConversation: (
|
||||
callback: (state: IClientConversation) => IClientConversation,
|
||||
) => void,
|
||||
) => {
|
||||
const removeMessageById = useCallback(
|
||||
(messageId: string) => {
|
||||
setCurrentConversation((pre) => {
|
||||
const nextMessages =
|
||||
pre.message?.filter(
|
||||
(x) => getMessagePureId(x.id) !== getMessagePureId(messageId),
|
||||
) ?? [];
|
||||
return {
|
||||
...pre,
|
||||
message: nextMessages,
|
||||
};
|
||||
});
|
||||
},
|
||||
[setCurrentConversation],
|
||||
);
|
||||
|
||||
return { removeMessageById };
|
||||
};
|
||||
|
||||
export const useRemoveMessagesAfterCurrentMessage = (
|
||||
setCurrentConversation: (
|
||||
callback: (state: IClientConversation) => IClientConversation,
|
||||
|
||||
Reference in New Issue
Block a user