mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
wip
This commit is contained in:
@@ -180,22 +180,9 @@ class NoteShort {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!(this.noteId in noteAttributeCache)) {
|
||||
const ownedAttributes = this.getOwnedAttributes();
|
||||
|
||||
const attrArrs = [
|
||||
ownedAttributes
|
||||
];
|
||||
|
||||
if (!(this.noteId in noteAttributeCache.attributes)) {
|
||||
const newPath = [...path, this.noteId];
|
||||
|
||||
for (const templateAttr of ownedAttributes.filter(oa => oa.type === 'relation' && oa.name === 'template')) {
|
||||
const templateNote = this.treeCache.notes[templateAttr.value];
|
||||
|
||||
if (templateNote && templateNote.noteId !== this.noteId) {
|
||||
attrArrs.push(templateNote.__getCachedAttributes(newPath));
|
||||
}
|
||||
}
|
||||
const attrArrs = [ this.getOwnedAttributes() ];
|
||||
|
||||
if (this.noteId !== 'root') {
|
||||
for (const parentNote of this.getParentNotes()) {
|
||||
@@ -206,6 +193,14 @@ class NoteShort {
|
||||
}
|
||||
}
|
||||
|
||||
for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' && attr.name === 'template')) {
|
||||
const templateNote = this.treeCache.notes[templateAttr.value];
|
||||
|
||||
if (templateNote && templateNote.noteId !== this.noteId) {
|
||||
attrArrs.push(templateNote.__getCachedAttributes(newPath));
|
||||
}
|
||||
}
|
||||
|
||||
noteAttributeCache.attributes[this.noteId] = attrArrs.flat();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user