diff --git a/src/services/note_cache/note_cache_loader.js b/src/services/note_cache/note_cache_loader.js index 0d53ea020..336deee5f 100644 --- a/src/services/note_cache/note_cache_loader.js +++ b/src/services/note_cache/note_cache_loader.js @@ -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) {