diff --git a/src/becca/entities/note.js b/src/becca/entities/note.js index 2410d7a7f..f966927ee 100644 --- a/src/becca/entities/note.js +++ b/src/becca/entities/note.js @@ -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);