mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
make sure the attribute is not duplicated in TreeCache and NoteCache, #1278
This commit is contained in:
@@ -92,7 +92,18 @@ class Note {
|
||||
}
|
||||
}
|
||||
|
||||
this.attributeCache = parentAttributes.concat(templateAttributes);
|
||||
this.attributeCache = [];
|
||||
|
||||
const addedAttributeIds = new Set();
|
||||
|
||||
for (const attr of parentAttributes.concat(templateAttributes)) {
|
||||
if (!addedAttributeIds.has(attr.attributeId)) {
|
||||
addedAttributeIds.add(attr.attributeId);
|
||||
|
||||
this.attributeCache.push(attr);
|
||||
}
|
||||
}
|
||||
|
||||
this.inheritableAttributeCache = [];
|
||||
|
||||
for (const attr of this.attributeCache) {
|
||||
|
||||
Reference in New Issue
Block a user