mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
note cache fixes, #1805
This commit is contained in:
@@ -234,11 +234,19 @@ class Note {
|
||||
this.ancestorCache = null;
|
||||
}
|
||||
|
||||
invalidateSubtreeCaches() {
|
||||
invalidateSubtreeCaches(path = []) {
|
||||
if (path.includes(this.noteId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.invalidateThisCache();
|
||||
|
||||
if (this.children.length || this.targetRelations.length) {
|
||||
path = [...path, this.noteId];
|
||||
}
|
||||
|
||||
for (const childNote of this.children) {
|
||||
childNote.invalidateSubtreeCaches();
|
||||
childNote.invalidateSubtreeCaches(path);
|
||||
}
|
||||
|
||||
for (const targetRelation of this.targetRelations) {
|
||||
@@ -246,7 +254,7 @@ class Note {
|
||||
const note = targetRelation.note;
|
||||
|
||||
if (note) {
|
||||
note.invalidateSubtreeCaches();
|
||||
note.invalidateSubtreeCaches(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user