mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix modifying index in note cache when deleting attribute, closes #1706
This commit is contained in:
parent
5b5c2a2dbb
commit
14ced949a9
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user