feat: annotation management frontend (#1764)

This commit is contained in:
Joel
2023-12-18 15:41:24 +08:00
committed by GitHub
parent 96d2de2258
commit 65fd4b39ce
122 changed files with 4718 additions and 214 deletions

View File

@@ -613,6 +613,22 @@ const Main: FC<IMainProps> = ({
))
}
},
onAnnotationReply: (annotationReply) => {
responseItem.content = annotationReply.answer
const newListWithAnswer = produce(
getChatList().filter(item => item.id !== responseItem.id && item.id !== placeholderAnswerId),
(draft) => {
if (!draft.find(item => item.id === questionId))
draft.push({ ...questionItem })
draft.push({
...responseItem,
id: annotationReply.id,
})
})
setChatList(newListWithAnswer)
tempNewConversationId = annotationReply.conversation_id
},
onError() {
setResponsingFalse()
// role back placeholder answer