mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
fix modifying index in note cache when deleting attribute, closes #1706
This commit is contained in:
@@ -120,7 +120,11 @@ eventService.subscribe([eventService.ENTITY_CHANGED, eventService.ENTITY_DELETED
|
|||||||
delete noteCache.attributes[attributeId];
|
delete noteCache.attributes[attributeId];
|
||||||
|
|
||||||
if (attr) {
|
if (attr) {
|
||||||
delete noteCache.attributeIndex[`${attr.type}-${attr.name.toLowerCase()}`];
|
const key = `${attr.type}-${attr.name.toLowerCase()}`;
|
||||||
|
|
||||||
|
if (key in noteCache.attributeIndex) {
|
||||||
|
noteCache.attributeIndex[key] = noteCache.attributeIndex[key].filter(attr => attr.attributeId !== attributeId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (attributeId in noteCache.attributes) {
|
else if (attributeId in noteCache.attributes) {
|
||||||
|
|||||||
Reference in New Issue
Block a user