From c6a05d8853dc0f8efb827f750d2bc8fb597ed084 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 23 Dec 2022 15:46:33 +0100 Subject: [PATCH] fix calendar widget when hoisted into hidden subtree --- src/public/app/components/note_context.js | 6 ++++-- src/public/app/services/hoisted_note.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/public/app/components/note_context.js b/src/public/app/components/note_context.js index b61667132..60f790b34 100644 --- a/src/public/app/components/note_context.js +++ b/src/public/app/components/note_context.js @@ -39,6 +39,8 @@ class NoteContext extends Component { async setNote(inputNotePath, triggerSwitchEvent = true) { const resolvedNotePath = await this.getResolvedNotePath(inputNotePath); + console.log("EEEEEE", inputNotePath, resolvedNotePath); + if (!resolvedNotePath) { return; } @@ -67,14 +69,14 @@ class NoteContext extends Component { && this.notePath.startsWith("root/_hidden") && !this.note.hasLabel("keepCurrentHoisting") ) { - // hidden subtree displays only when hoisted so it doesn't make sense to keep root as hoisted note + // 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'; + hoistedNoteId = '_options'; } await this.setHoistedNoteId(hoistedNoteId); diff --git a/src/public/app/services/hoisted_note.js b/src/public/app/services/hoisted_note.js index d29d30a1f..298af0895 100644 --- a/src/public/app/services/hoisted_note.js +++ b/src/public/app/services/hoisted_note.js @@ -54,8 +54,8 @@ async function checkNoteAccess(notePath, noteContext) { const requestedNote = await froca.getNote(treeService.getNoteIdFromNotePath(resolvedNotePath)); const hoistedNote = await froca.getNote(hoistedNoteId); - if (hoistedNote.hasAncestor('_hidden') - || !await dialogService.confirm(`Requested note '${requestedNote.title}' is outside of hoisted note '${hoistedNote.title}' subtree and you must unhoist to access the note. Do you want to proceed with unhoisting?`)) { + if (!hoistedNote.hasAncestor('_hidden') + && !await dialogService.confirm(`Requested note '${requestedNote.title}' is outside of hoisted note '${hoistedNote.title}' subtree and you must unhoist to access the note. Do you want to proceed with unhoisting?`)) { return false; }