mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 02:05:53 +01:00
WIP per-tab hoisting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user