mirror of
https://github.com/zadam/trilium.git
synced 2024-09-22 08:36:10 +08:00
fix searching without hoisting
This commit is contained in:
parent
e73e1262ae
commit
f763e13996
|
@ -219,13 +219,8 @@ function getNoteTitle(noteId, parentNoteId) {
|
|||
function getNoteTitleArrayForPath(path) {
|
||||
const titles = [];
|
||||
|
||||
if (path[0] === hoistedNoteService.getHoistedNoteId()) {
|
||||
if (path.length === 1) {
|
||||
return [ getNoteTitle(hoistedNoteService.getHoistedNoteId()) ];
|
||||
}
|
||||
else {
|
||||
path = path.slice(1);
|
||||
}
|
||||
if (path[0] === hoistedNoteService.getHoistedNoteId() && path.length === 1) {
|
||||
return [ getNoteTitle(hoistedNoteService.getHoistedNoteId()) ];
|
||||
}
|
||||
|
||||
let parentNoteId = 'root';
|
||||
|
@ -257,13 +252,13 @@ function getNoteTitleForPath(path) {
|
|||
|
||||
function getSomePath(noteId, path) {
|
||||
if (noteId === 'root') {
|
||||
path.push(noteId);
|
||||
path.reverse();
|
||||
|
||||
if (!path.includes(hoistedNoteService.getHoistedNoteId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
path.push(noteId);
|
||||
path.reverse();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue