Merge branch 'main' into feat-use-file-explorer

This commit is contained in:
Lost Paul 2023-04-04 19:40:17 +02:00 committed by GitHub
commit 7199679437
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ import { applyTemplate } from './template';
import { Commands } from './commands';
import DeleteConfirmationModal from './modals/deleteConfirmation';
import { FileExplorerWorkspaceLeaf } from './globals';
import { ExcludedFolder } from './settings';
export default class FolderNotesPlugin extends Plugin {
observer: MutationObserver;
@ -92,7 +93,7 @@ export default class FolderNotesPlugin extends Plugin {
event.stopImmediatePropagation();
const folder = event.target.parentElement?.getAttribute('data-path');
if(!folder) { return }
if (!folder) { return }
const excludedFolder = this.getExcludedFolderByPath(folder);
if (excludedFolder?.disableFolderNote) {
event.target.onclick = null;
@ -255,8 +256,8 @@ export default class FolderNotesPlugin extends Plugin {
getExcludedFolderByPath(path: string): ExcludedFolder | undefined {
return this.settings.excludeFolders.find((excludedFolder) => {
if(excludedFolder.path === path) { return true }
if(!excludedFolder.subFolders) { return false }
if (excludedFolder.path === path) { return true }
if (!excludedFolder.subFolders) { return false }
return this.getPathFromString(path).startsWith(excludedFolder.path)
})
}