Skip to content

Commit

Permalink
fix: hide the add button when the folder is a knowledge base (infinif…
Browse files Browse the repository at this point in the history
…low#765)

### What problem does this PR solve?

infiniflow#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)
  • Loading branch information
cike8899 committed May 14, 2024
1 parent d7744f5 commit 282f085
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions web/src/interfaces/database/file-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ export interface IFolder {
type: string;
update_date: string;
update_time: number;
source_type: string;
}
5 changes: 4 additions & 1 deletion web/src/pages/file-manager/file-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
useSelectBreadcrumbItems,
} from './hooks';

import { useSelectParentFolderList } from '@/hooks/fileManagerHooks';
import styles from './index.less';

interface IProps {
Expand All @@ -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,
Expand Down

0 comments on commit 282f085

Please sign in to comment.