From cc1b452872257b7000b435f92383412618aad139 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Fri, 24 Oct 2025 13:36:33 +0200 Subject: [PATCH] Extracts note command execute validation logic Refactors active note validation into a dedicated static method for improved readability and reusability Enhances code maintainability by centralizing the check for valid editor and view --- commands/notePrompts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/notePrompts.ts b/commands/notePrompts.ts index cc3e842..2e72fe1 100644 --- a/commands/notePrompts.ts +++ b/commands/notePrompts.ts @@ -50,7 +50,7 @@ export class NotePromptsCommand { editor: Editor, view: MarkdownView ): Promise { - if (!editor || !view) { + if (!NotePromptsCommand.canExecute(editor, view)) { new Notice('No active note found. Please open a note first.'); return; }