Skip to content

Commit

Permalink
Merge pull request #4635 from WantToLearnJapanese/WantToLearnJapanese…
Browse files Browse the repository at this point in the history
…-patch-unhoist-bookmark

Fix showing unhoist confirm dialogue for bookmarked notes.
  • Loading branch information
zadam authored Feb 16, 2024
2 parents 2d86557 + a939599 commit 4ef31ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/public/app/services/hoisted_note.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4ef31ea

Please sign in to comment.