diff --git a/web/app/components/base/notion-page-selector/page-selector/index.tsx b/web/app/components/base/notion-page-selector/page-selector/index.tsx index 498955994c..33d02da772 100644 --- a/web/app/components/base/notion-page-selector/page-selector/index.tsx +++ b/web/app/components/base/notion-page-selector/page-selector/index.tsx @@ -82,7 +82,19 @@ const ItemComponent = ({ index, style, data }: ListChildComponentProps<{ pagesMap: DataSourceNotionPageMap }>) => { const { t } = useTranslation() - const { dataList, handleToggle, checkedIds, disabledCheckedIds, handleCheck, canPreview, handlePreview, listMapWithChildrenAndDescendants, searchValue, previewPageId, pagesMap } = data + const { + dataList, + handleToggle, + checkedIds, + disabledCheckedIds, + handleCheck, + canPreview, + handlePreview, + listMapWithChildrenAndDescendants, + searchValue, + previewPageId, + pagesMap, + } = data const current = dataList[index] const currentWithChildrenAndDescendants = listMapWithChildrenAndDescendants[current.page_id] const hasChild = currentWithChildrenAndDescendants.descendants.size > 0 diff --git a/web/app/components/datasets/documents/create-from-pipeline/hooks.ts b/web/app/components/datasets/documents/create-from-pipeline/hooks.ts index 9dc608c2c8..01dfd040df 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/hooks.ts +++ b/web/app/components/datasets/documents/create-from-pipeline/hooks.ts @@ -122,7 +122,7 @@ export const useLocalFile = () => { export const useOnlineDocuments = () => { const [onlineDocuments, setOnlineDocuments] = useState([]) - const [currentDocuments, setCurrentDocuments] = useState() + const [currentDocument, setCurrentDocument] = useState() const previewOnlineDocument = useRef(onlineDocuments[0]) @@ -131,18 +131,18 @@ export const useOnlineDocuments = () => { } const updateCurrentPage = useCallback((page: NotionPage) => { - setCurrentDocuments(page) + setCurrentDocument(page) }, []) const hideOnlineDocumentPreview = useCallback(() => { - setCurrentDocuments(undefined) + setCurrentDocument(undefined) }, []) return { onlineDocuments, previewOnlineDocument, updateOnlineDocuments, - currentDocuments, + currentDocument, updateCurrentPage, hideOnlineDocumentPreview, } diff --git a/web/app/components/datasets/documents/create-from-pipeline/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/index.tsx index 2bb8748d9b..5fb587d91f 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/index.tsx @@ -63,7 +63,7 @@ const CreateFormPipeline = () => { onlineDocuments, previewOnlineDocument, updateOnlineDocuments, - currentDocuments, + currentDocument, updateCurrentPage, hideOnlineDocumentPreview, } = useOnlineDocuments() @@ -324,7 +324,7 @@ const CreateFormPipeline = () => {
{currentFile && } - {currentDocuments && } + {currentDocument && } {currentWebsite && }
diff --git a/web/service/knowledge/use-dataset.ts b/web/service/knowledge/use-dataset.ts index 96eedbbafb..721f4a68a6 100644 --- a/web/service/knowledge/use-dataset.ts +++ b/web/service/knowledge/use-dataset.ts @@ -63,6 +63,7 @@ export const usePreviewNotionPage = (params: NotionPagePreviewRequest) => { queryKey: [NAME_SPACE, 'preview-notion-page'], queryFn: () => get(`notion/workspaces/${workspaceID}/pages/${pageID}/${pageType}/preview`), enabled: !!workspaceID && !!pageID && !!pageType, + staleTime: 0, }) }