mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 16:55:50 +01:00
make sure the attribute is not duplicated in TreeCache and NoteCache, #1278
This commit is contained in:
@@ -205,7 +205,16 @@ class NoteShort {
|
||||
}
|
||||
}
|
||||
|
||||
noteAttributeCache.attributes[this.noteId] = attrArrs.flat();
|
||||
noteAttributeCache.attributes[this.noteId] = [];
|
||||
const addedAttributeIds = new Set();
|
||||
|
||||
for (const attr of attrArrs.flat()) {
|
||||
if (!addedAttributeIds.has(attr.attributeId)) {
|
||||
addedAttributeIds.add(attr.attributeId);
|
||||
|
||||
noteAttributeCache.attributes[this.noteId].push(attr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return noteAttributeCache.attributes[this.noteId];
|
||||
|
||||
Reference in New Issue
Block a user