mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 08:36:07 +08:00
fix: white screen when editing annotaion in log panel (#2968)
This commit is contained in:
parent
c60749678b
commit
58e4702b14
@ -212,16 +212,18 @@ const Chat: FC<IChatProps> = ({
|
|||||||
if (i === index) {
|
if (i === index) {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
content: answer,
|
|
||||||
annotation: {
|
annotation: {
|
||||||
...item.annotation,
|
...item.annotation,
|
||||||
logAnnotation: undefined,
|
logAnnotation: {
|
||||||
|
...item.annotation?.logAnnotation,
|
||||||
|
content: answer,
|
||||||
|
},
|
||||||
} as any,
|
} as any,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
}))
|
}))
|
||||||
}, [])
|
}, [chatList])
|
||||||
const handleAnnotationAdded = useCallback((annotationId: string, authorName: string, query: string, answer: string, index: number) => {
|
const handleAnnotationAdded = useCallback((annotationId: string, authorName: string, query: string, answer: string, index: number) => {
|
||||||
onChatListChange?.(chatList.map((item, i) => {
|
onChatListChange?.(chatList.map((item, i) => {
|
||||||
if (i === index - 1) {
|
if (i === index - 1) {
|
||||||
@ -251,7 +253,7 @@ const Chat: FC<IChatProps> = ({
|
|||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
}))
|
}))
|
||||||
}, [])
|
}, [chatList])
|
||||||
const handleAnnotationRemoved = useCallback((index: number) => {
|
const handleAnnotationRemoved = useCallback((index: number) => {
|
||||||
onChatListChange?.(chatList.map((item, i) => {
|
onChatListChange?.(chatList.map((item, i) => {
|
||||||
if (i === index) {
|
if (i === index) {
|
||||||
@ -261,12 +263,13 @@ const Chat: FC<IChatProps> = ({
|
|||||||
annotation: {
|
annotation: {
|
||||||
...(item.annotation || {}),
|
...(item.annotation || {}),
|
||||||
id: '',
|
id: '',
|
||||||
|
logAnnotation: undefined, // remove log
|
||||||
} as Annotation,
|
} as Annotation,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
}))
|
}))
|
||||||
}, [])
|
}, [chatList])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('px-3.5', 'h-full')}>
|
<div className={cn('px-3.5', 'h-full')}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user