Skip to content

Commit

Permalink
Fix: fix individual files not showing correct icon (#1125)
Browse files Browse the repository at this point in the history
Signed-off-by: Daishan Peng <[email protected]>
  • Loading branch information
StrongMonkey authored Jan 7, 2025
1 parent 7fbb401 commit eb23ea5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ui/admin/app/components/knowledge/FileTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ export default function FileTreeNode({
const file = node.file!;

const included =
source.filePathPrefixInclude?.some((prefix) =>
(source.filePathPrefixInclude?.some((prefix) =>
node.path.startsWith(prefix)
) &&
!source.filePathPrefixExclude?.some((prefix) =>
node.path.startsWith(prefix)
);
!source.filePathPrefixExclude?.some((prefix) =>
node.path.startsWith(prefix)
)) ||
(node.file && node.file.approved);

const excluded = source.filePathPrefixExclude?.some((prefix) =>
node.path.startsWith(prefix)
Expand Down Expand Up @@ -299,8 +300,8 @@ export default function FileTreeNode({
</TooltipTrigger>
<TooltipContent>
{included
? "Exclude folder from Knowledge"
: "Add folder to Knowledge"}
? "Exclude from Knowledge"
: "Add to Knowledge"}
</TooltipContent>
</Tooltip>
</Button>
Expand Down

0 comments on commit eb23ea5

Please sign in to comment.