From a939599223c7843a6b3e5316bb7c6914beacf48c Mon Sep 17 00:00:00 2001 From: WantToLearnJapanese Date: Fri, 2 Feb 2024 16:36:54 +0900 Subject: [PATCH] Fix showing unhoist confirm dialogue for bookmarked notes. --- src/public/app/services/hoisted_note.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/app/services/hoisted_note.js b/src/public/app/services/hoisted_note.js index f0accda7f9..267f3e4e9d 100644 --- a/src/public/app/services/hoisted_note.js +++ b/src/public/app/services/hoisted_note.js @@ -48,11 +48,11 @@ async function checkNoteAccess(notePath, noteContext) { const hoistedNoteId = noteContext.hoistedNoteId; - if (!resolvedNotePath.includes(hoistedNoteId) && !resolvedNotePath.includes('_hidden')) { + if (!resolvedNotePath.includes(hoistedNoteId) && (!resolvedNotePath.includes('_hidden') || resolvedNotePath.includes('_lbBookmarks')) { const requestedNote = await froca.getNote(treeService.getNoteIdFromUrl(resolvedNotePath)); const hoistedNote = await froca.getNote(hoistedNoteId); - if (!hoistedNote.hasAncestor('_hidden') + if ((!hoistedNote.hasAncestor('_hidden') || resolvedNotePath.includes('_lbBookmarks')) && !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; }