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
This commit is contained in:
AlexKucera committed 2025-10-24 13:36:33 +02:00
1 parent c698a19345
commit cc1b452872
1 file changed
+1 -1
+1 -1
View File
@@ -50,7 +50,7 @@ export class NotePromptsCommand {
editor: Editor, editor: Editor,
view: MarkdownView view: MarkdownView
): Promise<void> { ): Promise<void> {
if (!editor || !view) { if (!NotePromptsCommand.canExecute(editor, view)) {
new Notice('No active note found. Please open a note first.'); new Notice('No active note found. Please open a note first.');
return; return;
} }