From 1d03bc2c365ff1b4e198bb27e67dc09ec1550bb2 Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Fri, 26 Apr 2024 09:47:00 +0200 Subject: [PATCH] Possible fix for #83 --- src/note.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/note.ts b/src/note.ts index 7835f94..265decf 100644 --- a/src/note.ts +++ b/src/note.ts @@ -67,9 +67,9 @@ export default class Note { constructor (plugin: SharePlugin) { this.plugin = plugin // .getLeaf() doesn't return a `previewMode` property when a note is pinned, - // so use the activeEditor.leaf + // so use the undocumented .getActiveFileView() which seems to work fine // @ts-ignore - this.leaf = this.plugin.app.workspace.activeEditor?.leaf + this.leaf = this.plugin.app.workspace.getActiveFileView()?.leaf this.elements = [] this.template = new NoteTemplate() }