mirror of
https://github.com/zadam/trilium.git
synced 2025-01-15 19:51:57 +08:00
make getAncestors
safe in respect to saved search
This commit is contained in:
parent
fa2ffd7574
commit
7495777d97
1 changed files with 5 additions and 3 deletions
|
@ -865,11 +865,13 @@ class Note extends AbstractEntity {
|
|||
this.ancestorCache = [];
|
||||
|
||||
for (const parent of this.parents) {
|
||||
if (!noteIds.has(parent.noteId)) {
|
||||
this.ancestorCache.push(parent);
|
||||
noteIds.add(parent.noteId);
|
||||
if (noteIds.has(parent.noteId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.ancestorCache.push(parent);
|
||||
noteIds.add(parent.noteId);
|
||||
|
||||
for (const ancestorNote of parent.getAncestors()) {
|
||||
if (!noteIds.has(ancestorNote.noteId)) {
|
||||
this.ancestorCache.push(ancestorNote);
|
||||
|
|
Loading…
Reference in a new issue