fix: update dependencies array in useMemo hooks

This commit is contained in:
twwu 2024-12-16 12:49:06 +08:00
parent d5cb3af293
commit 340a052d44
2 changed files with 2 additions and 3 deletions

View File

@ -79,9 +79,8 @@ const ChildSegmentList: FC<IChildSegmentCardProps> = ({
const count = text === '--' ? 0 : total
return `${count} ${t('datasetDocuments.segment.searchResults', { count })}`
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isFullDocMode, total, childChunks.length])
}, [isFullDocMode, total, childChunks.length, inputValue])
return (
<div className={classNames('flex flex-col', contentOpacity, isParagraphMode ? 'p-1 pb-2' : 'px-3 grow')}>

View File

@ -350,7 +350,7 @@ const Completed: FC<ICompletedProps> = ({
return `${total} ${t('datasetDocuments.segment.searchResults', { count })}`
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [segmentListData?.total, mode, parentMode])
}, [segmentListData?.total, mode, parentMode, searchValue, selectedStatus])
const toggleFullScreen = useCallback(() => {
setFullScreen(!fullScreen)