Skip to content

Commit

Permalink
fix: disable selecting excluded files
Browse files Browse the repository at this point in the history
  • Loading branch information
devcatalin committed Nov 18, 2021
1 parent 0c14241 commit 88c9a4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/organisms/FileTreePane/FileTreePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ const FileTreePane = () => {
const loadLastFolderOnStartup = useAppSelector(state => state.config.settings.loadLastFolderOnStartup);
const recentFolders = useAppSelector(state => state.config.recentFolders);
const fileIncludes = useAppSelector(state => state.config.fileIncludes);
const scanExcludes = useAppSelector(state => state.config.scanExcludes);
const shouldExpandAllNodes = useAppSelector(state => state.ui.shouldExpandAllNodes);
const [tree, setTree] = useState<TreeNode | null>(null);
const [expandedKeys, setExpandedKeys] = useState<Array<React.Key>>([]);
Expand Down Expand Up @@ -559,6 +560,9 @@ const FileTreePane = () => {
if (!fileIncludes.some(fileInclude => micromatch.isMatch(path.basename(info.node.key), fileInclude))) {
return;
}
if (scanExcludes.some(scanExclude => micromatch.isMatch(path.basename(info.node.key), scanExclude))) {
return;
}
if (info.node.key) {
if (isInPreviewMode) {
stopPreview(dispatch);
Expand Down

0 comments on commit 88c9a4d

Please sign in to comment.