From ca5081e3272a2e9d3df669d4b9725dfaf40b6e90 Mon Sep 17 00:00:00 2001 From: Louie Long Date: Thu, 9 May 2024 12:53:06 +0800 Subject: [PATCH] fix delete log annotation (#4201) Co-authored-by: langyong --- web/app/components/app/chat/index.tsx | 6 +----- web/app/components/app/log/list.tsx | 4 ++-- web/models/log.ts | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/web/app/components/app/chat/index.tsx b/web/app/components/app/chat/index.tsx index e1fe5589e..6187ec684 100644 --- a/web/app/components/app/chat/index.tsx +++ b/web/app/components/app/chat/index.tsx @@ -260,11 +260,7 @@ const Chat: FC = ({ return { ...item, content: item.content, - annotation: { - ...(item.annotation || {}), - id: '', - logAnnotation: undefined, // remove log - } as Annotation, + annotation: undefined, } } return item diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx index 026db4da2..3c420d342 100644 --- a/web/app/components/app/log/list.tsx +++ b/web/app/components/app/log/list.tsx @@ -137,8 +137,8 @@ const getFormattedChatList = (messages: ChatMessage[], conversationId: string, t if (item.annotation) { return { - id: '', - authorName: '', + id: item.annotation.id, + authorName: item.annotation.account.name, logAnnotation: item.annotation, created_at: 0, } diff --git a/web/models/log.ts b/web/models/log.ts index 3b893e1e8..994da445d 100644 --- a/web/models/log.ts +++ b/web/models/log.ts @@ -57,6 +57,7 @@ export type ModelConfigDetail = { } export type LogAnnotation = { + id: string content: string account: { id: string