瀏覽代碼

fix: white screen when editing annotaion in log panel (#2968)

tags/0.5.11
Ricky 1 年之前
父節點
當前提交
58e4702b14
No account linked to committer's email address
共有 1 個文件被更改,包括 8 次插入5 次删除
  1. 8
    5
      web/app/components/app/chat/index.tsx

+ 8
- 5
web/app/components/app/chat/index.tsx 查看文件

@@ -212,16 +212,18 @@ const Chat: FC<IChatProps> = ({
if (i === index) {
return {
...item,
content: answer,
annotation: {
...item.annotation,
logAnnotation: undefined,
logAnnotation: {
...item.annotation?.logAnnotation,
content: answer,
},
} as any,
}
}
return item
}))
}, [])
}, [chatList])
const handleAnnotationAdded = useCallback((annotationId: string, authorName: string, query: string, answer: string, index: number) => {
onChatListChange?.(chatList.map((item, i) => {
if (i === index - 1) {
@@ -251,7 +253,7 @@ const Chat: FC<IChatProps> = ({
}
return item
}))
}, [])
}, [chatList])
const handleAnnotationRemoved = useCallback((index: number) => {
onChatListChange?.(chatList.map((item, i) => {
if (i === index) {
@@ -261,12 +263,13 @@ const Chat: FC<IChatProps> = ({
annotation: {
...(item.annotation || {}),
id: '',
logAnnotation: undefined, // remove log
} as Annotation,
}
}
return item
}))
}, [])
}, [chatList])

return (
<div className={cn('px-3.5', 'h-full')}>

Loading…
取消
儲存