WIP per-tab hoisting

This commit is contained in:
zadam
2020-11-23 23:11:21 +01:00
parent 52b8162d01
commit ac636b6649
5 changed files with 11 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ function isRootNode(node) {
|| node.data.noteId === getHoistedNoteId();
}
async function checkNoteAccess(notePath) {
async function checkNoteAccess(notePath, tabContext) {
// notePath argument can contain only noteId which is not good when hoisted since
// then we need to check the whole note path
const resolvedNotePath = await treeService.resolveNotePath(notePath);
@@ -35,11 +35,11 @@ async function checkNoteAccess(notePath) {
return false;
}
const hoistedNoteId = getHoistedNoteId();
const hoistedNoteId = tabContext.hoistedNoteId;
if (hoistedNoteId !== 'root' && !resolvedNotePath.includes(hoistedNoteId)) {
const confirmDialog = await import('../dialogs/confirm.js');
console.trace("HI!", hoistedNoteId, notePath);
if (!await confirmDialog.confirm("Requested note is outside of hoisted note subtree and you must unhoist to access the note. Do you want to proceed with unhoisting?")) {
return false;
}