From c44bc606672ea8baa15127478689853e04260423 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 8 Dec 2022 23:36:49 +0100 Subject: [PATCH] when opening a note from hidden subtree, make sure we're hoisted --- src/public/app/components/note_context.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/public/app/components/note_context.js b/src/public/app/components/note_context.js index 7a05ad499..6b4bc62b6 100644 --- a/src/public/app/components/note_context.js +++ b/src/public/app/components/note_context.js @@ -59,6 +59,22 @@ class NoteContext extends Component { }); } + console.log(resolvedNotePath, "resolvedNotePath"); + + if (this.hoistedNoteId === 'root' && this.notePath.startsWith("root/hidden")) { + // hidden subtree displays only when hoisted so it doesn't make sense to keep root as hoisted note + + let hoistedNoteId = 'hidden'; + + if (this.note.isLaunchBarConfig()) { + hoistedNoteId = 'lbRoot'; + } else if (this.note.isOptions()) { + hoistedNoteId = 'options'; + } + + await this.setHoistedNoteId(hoistedNoteId); + } + if (utils.isDesktop()) { // close dangling autocompletes after closing the tab $(".aa-input").autocomplete("close");