From 78bc6a66bcc91be884c64fd9c7d0d39b1c11f388 Mon Sep 17 00:00:00 2001 From: Southpaw Date: Tue, 15 Aug 2023 09:38:02 +0100 Subject: [PATCH] Use view workspace instead of global app workspace --- src/methods/publishPost.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/methods/publishPost.ts b/src/methods/publishPost.ts index 1080c05..aa6fac6 100644 --- a/src/methods/publishPost.ts +++ b/src/methods/publishPost.ts @@ -35,7 +35,7 @@ export const publishPost = async ( }); // get frontmatter - const noteFile = app.workspace.getActiveFile(); + const noteFile = view.app.workspace.getActiveFile(); const metaMatter = app.metadataCache.getFileCache(noteFile).frontmatter; const data = matter(view.getViewData());