浏览代码

fix delete log annotation (#4201)

Co-authored-by: langyong <langyong@lixiang.com>
Louie Long 11 月之前
父节点
当前提交
ca5081e327
共有 3 个文件被更改,包括 4 次插入7 次删除
  1. 1 5
      web/app/components/app/chat/index.tsx
  2. 2 2
      web/app/components/app/log/list.tsx
  3. 1 0
      web/models/log.ts

+ 1 - 5
web/app/components/app/chat/index.tsx

@@ -260,11 +260,7 @@ const Chat: FC<IChatProps> = ({
         return {
           ...item,
           content: item.content,
-          annotation: {
-            ...(item.annotation || {}),
-            id: '',
-            logAnnotation: undefined, // remove log
-          } as Annotation,
+          annotation: undefined,
         }
       }
       return item

+ 2 - 2
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,
           }

+ 1 - 0
web/models/log.ts

@@ -57,6 +57,7 @@ export type ModelConfigDetail = {
 }
 
 export type LogAnnotation = {
+  id: string
   content: string
   account: {
     id: string