change the heuristics to choose the best note path when ambiguous/incomplete/just noteId is provided, #1711

This commit is contained in:
zadam
2021-03-06 20:23:29 +01:00
parent 060d4fc27b
commit 9f002fa802
5 changed files with 60 additions and 43 deletions

View File

@@ -16,10 +16,10 @@ async function unhoist() {
}
function isTopLevelNode(node) {
return isRootNode(node.getParent());
return isHoistedNode(node.getParent());
}
function isRootNode(node) {
function isHoistedNode(node) {
// even though check for 'root' should not be necessary, we keep it just in case
return node.data.noteId === "root"
|| node.data.noteId === getHoistedNoteId();
@@ -55,6 +55,6 @@ export default {
getHoistedNoteId,
unhoist,
isTopLevelNode,
isRootNode,
isHoistedNode,
checkNoteAccess
}