From a0dcdabed204458d1d216cdd958b36743e017872 Mon Sep 17 00:00:00 2001 From: caffae Date: Sun, 29 Dec 2024 22:16:55 +0800 Subject: [PATCH] Fixed up the unloading - refresh view will remove other leaves --- main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.ts b/main.ts index 316a48a..ddea2e1 100644 --- a/main.ts +++ b/main.ts @@ -138,6 +138,12 @@ export default class CurrentFolderNotesDisplay extends Plugin { // A leaf with our view already exists, use that const view = leaves[0].view as CurrentFolderNotesDisplayView; await view.displayNotesInCurrentFolder(); + + // Remove all other leaves + for (let i = 1; i < leaves.length; i++) { + leaves[i].detach(); + } + } else { // new Notice('Could not find the view'); this.activateView();