mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix: after logging out and entering the knowledge base page again, the data before still exists #1306 (#1597)
### What problem does this PR solve? fix: after logging out and entering the knowledge base page again, the data before still exists #1306 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { useFetchKnowledgeList } from '@/hooks/knowledge-hooks';
|
||||
import { useNextFetchKnowledgeList } from '@/hooks/knowledge-hooks';
|
||||
import { IModalProps } from '@/interfaces/common';
|
||||
import { filterOptionsByInput } from '@/utils/commonUtil';
|
||||
import { Form, Modal, Select } from 'antd';
|
||||
@ -13,7 +13,7 @@ const ConnectToKnowledgeModal = ({
|
||||
loading,
|
||||
}: IModalProps<string[]> & { initialValue: string[] }) => {
|
||||
const [form] = Form.useForm();
|
||||
const { list, fetchList } = useFetchKnowledgeList();
|
||||
const { list } = useNextFetchKnowledgeList();
|
||||
const { t } = useTranslate('fileManager');
|
||||
|
||||
const options = list?.map((item) => ({
|
||||
@ -30,9 +30,8 @@ const ConnectToKnowledgeModal = ({
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
form.setFieldValue('knowledgeIds', initialValue);
|
||||
fetchList();
|
||||
}
|
||||
}, [visible, fetchList, initialValue, form]);
|
||||
}, [visible, initialValue, form]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
||||
Reference in New Issue
Block a user