diff --git a/ui/admin/app/components/knowledge/FileTree.tsx b/ui/admin/app/components/knowledge/FileTree.tsx index 09bebb8f8..e54afe10f 100644 --- a/ui/admin/app/components/knowledge/FileTree.tsx +++ b/ui/admin/app/components/knowledge/FileTree.tsx @@ -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) @@ -299,8 +300,8 @@ export default function FileTreeNode({ {included - ? "Exclude folder from Knowledge" - : "Add folder to Knowledge"} + ? "Exclude from Knowledge" + : "Add to Knowledge"}