mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 20:21:43 +08:00
fix modifying index in note cache when deleting attribute, closes #1706
This commit is contained in:
parent
5b5c2a2dbb
commit
14ced949a9
1 changed files with 5 additions and 1 deletions
|
@ -120,7 +120,11 @@ eventService.subscribe([eventService.ENTITY_CHANGED, eventService.ENTITY_DELETED
|
|||
delete noteCache.attributes[attributeId];
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue