(feature)(webapp) add filter modify and similar questions (#213)

This commit is contained in:
williamhliu
2023-10-13 18:31:00 +08:00
committed by GitHub
parent ab19b18169
commit 767abc2b90
27 changed files with 799 additions and 795 deletions

View File

@@ -309,21 +309,11 @@ const Chat: ForwardRefRenderFunction<any, Props> = (
if (!data) {
return;
}
let parseOptionsItem: any;
if (data.parseOptions && data.parseOptions.length > 0) {
parseOptionsItem = {
id: uuid(),
msg: messageList[messageList.length - 1]?.msg,
type: MessageTypeEnum.PARSE_OPTIONS,
parseOptions: data.parseOptions,
};
}
const msgs = cloneDeep(messageList);
const msg = msgs.find(item => item.id === questionId);
if (msg) {
msg.msgData = data;
const msgList = [...msgs, ...(parseOptionsItem ? [parseOptionsItem] : [])];
setMessageList(msgList);
setMessageList(msgs);
}
updateMessageContainerScroll(`${questionId}`);
};