mirror of
https://github.com/zadam/trilium.git
synced 2025-02-25 07:25:32 +08:00
fix "root" note in autocomplete when hoisted into another subtree
This commit is contained in:
parent
b567775129
commit
ef825371cf
1 changed files with 3 additions and 4 deletions
|
@ -83,10 +83,8 @@ function getNoteTitleArrayForPath(notePathArray) {
|
||||||
throw new Error(`${notePathArray} is not an array.`);
|
throw new Error(`${notePathArray} is not an array.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const hoistedNoteId = cls.getHoistedNoteId();
|
if (notePathArray.length === 1) {
|
||||||
|
return [getNoteTitle(notePathArray[0])];
|
||||||
if (notePathArray.length === 1 && notePathArray[0] === hoistedNoteId) {
|
|
||||||
return [getNoteTitle(hoistedNoteId)];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const titles = [];
|
const titles = [];
|
||||||
|
@ -95,6 +93,7 @@ function getNoteTitleArrayForPath(notePathArray) {
|
||||||
let hoistedNotePassed = false;
|
let hoistedNotePassed = false;
|
||||||
|
|
||||||
// this is a notePath from outside of hoisted subtree so full title path needs to be returned
|
// this is a notePath from outside of hoisted subtree so full title path needs to be returned
|
||||||
|
const hoistedNoteId = cls.getHoistedNoteId();
|
||||||
const outsideOfHoistedSubtree = !notePathArray.includes(hoistedNoteId);
|
const outsideOfHoistedSubtree = !notePathArray.includes(hoistedNoteId);
|
||||||
|
|
||||||
for (const noteId of notePathArray) {
|
for (const noteId of notePathArray) {
|
||||||
|
|
Loading…
Reference in a new issue