fix: hide the add button when the folder is a knowledge base (#765)

### What problem does this PR solve?

#764 fix: hide the add button when the folder is a knowledge base

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu 2024-05-14 16:53:32 +08:00 committed by GitHub
parent d7744f5870
commit 282f0857a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -28,4 +28,5 @@ export interface IFolder {
type: string;
update_date: string;
update_time: number;
source_type: string;
}

View File

@ -26,6 +26,7 @@ import {
useSelectBreadcrumbItems,
} from './hooks';
import { useSelectParentFolderList } from '@/hooks/fileManagerHooks';
import styles from './index.less';
interface IProps {
@ -46,7 +47,9 @@ const FileToolbar = ({
const { handleInputChange, searchString } = useHandleSearchChange();
const breadcrumbItems = useSelectBreadcrumbItems();
const { handleBreadcrumbClick } = useHandleBreadcrumbClick();
const isKnowledgeBase = breadcrumbItems.at(-1)?.title === '.knowledgebase';
const parentFolderList = useSelectParentFolderList();
const isKnowledgeBase =
parentFolderList.at(-1)?.source_type === 'knowledgebase';
const itemRender: BreadcrumbProps['itemRender'] = (
currentRoute,