From 219647482c2f8ce2ed64aeffe27bde2d40a3e4c3 Mon Sep 17 00:00:00 2001 From: Lost Paul <70213368+LostPaul@users.noreply.github.com> Date: Tue, 27 May 2025 19:03:03 +0200 Subject: [PATCH] Fix #218 --- src/Commands.ts | 4 ++-- src/ExcludeFolders/functions/folderFunctions.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands.ts b/src/Commands.ts index f0654a1..b0f9e2a 100644 --- a/src/Commands.ts +++ b/src/Commands.ts @@ -251,7 +251,7 @@ export class Commands { } fileCommands() { - this.plugin.registerEvent(this.app.workspace.on('file-menu', async (menu: Menu, file: TAbstractFile) => { + this.plugin.registerEvent(this.app.workspace.on('file-menu', (menu: Menu, file: TAbstractFile) => { let folder: TAbstractFile | TFolder | null = file.parent; if (file instanceof TFile) { if (this.plugin.settings.storageLocation === 'insideFolder') { @@ -269,7 +269,7 @@ export class Commands { if (folder instanceof TFolder) { const folderNote = getFolderNote(this.plugin, folder.path); - const excludedFolder = await getExcludedFolder(this.plugin, folder.path, true); + const excludedFolder = getExcludedFolder(this.plugin, folder.path, true); if (folderNote?.path === file.path && !excludedFolder?.detached) { return; } } else if (file.parent instanceof TFolder) { folder = file.parent; diff --git a/src/ExcludeFolders/functions/folderFunctions.ts b/src/ExcludeFolders/functions/folderFunctions.ts index 91a1627..cc9e586 100644 --- a/src/ExcludeFolders/functions/folderFunctions.ts +++ b/src/ExcludeFolders/functions/folderFunctions.ts @@ -11,7 +11,7 @@ import { getWhitelistedFolder } from './whitelistFolderFunctions'; import { WhitelistedFolder } from '../WhitelistFolder'; import { WhitelistedPattern } from '../WhitelistPattern'; -export async function getExcludedFolder(plugin: FolderNotesPlugin, path: string, includeDetached: boolean, pathOnly?: boolean, ignoreWhitelist?: boolean) { +export function getExcludedFolder(plugin: FolderNotesPlugin, path: string, includeDetached: boolean, pathOnly?: boolean, ignoreWhitelist?: boolean) { let excludedFolder = {} as ExcludedFolder | ExcludePattern | undefined; const whitelistedFolder = getWhitelistedFolder(plugin, path) as WhitelistedFolder | WhitelistedPattern | undefined; const folderName = getFolderNameFromPathString(path);