fix: fixed the issue where ChunkMethodModal cannot correctly display … (#189)

fix: fixed the issue where ChunkMethodModal cannot correctly display the
current chunk method when switching chunk methods between two document
rows.
This commit is contained in:
balibabu
2024-04-01 18:11:07 +08:00
committed by GitHub
parent d5587a7cc1
commit 6cf088911f
7 changed files with 30 additions and 31 deletions

View File

@@ -46,6 +46,7 @@ const getParserList = (
};
export const useFetchParserListOnMount = (
documentId: string,
parserId: string,
documentExtension: string,
) => {
@@ -71,7 +72,7 @@ export const useFetchParserListOnMount = (
useEffect(() => {
setSelectedTag(parserId);
}, [parserId]);
}, [parserId, documentId]);
const handleChange = (tag: string, checked: boolean) => {
const nextSelectedTag = checked ? tag : selectedTag;

View File

@@ -36,11 +36,13 @@ interface IProps extends Omit<IModalManagerChildrenProps, 'showModal'> {
parserId: string;
parserConfig: IKnowledgeFileParserConfig;
documentExtension: string;
documentId: string;
}
const hidePagesChunkMethods = ['qa', 'table', 'picture', 'resume', 'one'];
const ChunkMethodModal: React.FC<IProps> = ({
documentId,
parserId,
onOk,
hideModal,
@@ -49,6 +51,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
parserConfig,
}) => {
const { parserList, handleChange, selectedTag } = useFetchParserListOnMount(
documentId,
parserId,
documentExtension,
);