mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-22 06:06:40 +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:
@ -8,9 +8,10 @@ import {
|
||||
} from '@ant-design/icons';
|
||||
import { Avatar, Card, Space } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useDispatch, useNavigate } from 'umi';
|
||||
import { useNavigate } from 'umi';
|
||||
|
||||
import OperateDropdown from '@/components/operate-dropdown';
|
||||
import { useDeleteKnowledge } from '@/hooks/knowledge-hooks';
|
||||
import styles from './index.less';
|
||||
|
||||
interface IProps {
|
||||
@ -19,16 +20,12 @@ interface IProps {
|
||||
|
||||
const KnowledgeCard = ({ item }: IProps) => {
|
||||
const navigate = useNavigate();
|
||||
const dispatch = useDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { deleteKnowledge } = useDeleteKnowledge();
|
||||
|
||||
const removeKnowledge = async () => {
|
||||
return dispatch({
|
||||
type: 'knowledgeModel/rmKb',
|
||||
payload: {
|
||||
kb_id: item.id,
|
||||
},
|
||||
});
|
||||
return deleteKnowledge(item.id);
|
||||
};
|
||||
|
||||
const handleCardClick = () => {
|
||||
|
||||
Reference in New Issue
Block a user