Skip to content

Commit

Permalink
Fixed up the unloading - refresh view will remove other leaves
Browse files Browse the repository at this point in the history
  • Loading branch information
Caffa committed Dec 29, 2024
1 parent b661cdd commit a0dcdab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a0dcdab

Please sign in to comment.