diff --git a/src/common/catalog/catalog-category-registry.ts b/src/common/catalog/catalog-category-registry.ts index 3b1d5bb00a..3ea2c6a189 100644 --- a/src/common/catalog/catalog-category-registry.ts +++ b/src/common/catalog/catalog-category-registry.ts @@ -29,18 +29,14 @@ export class CatalogCategoryRegistry { @action add(category: CatalogCategory): Disposer { this.categories.add(category); - this.updateGroupKinds(category); - - return () => { - this.categories.delete(category); - this.groupKinds.clear(); - }; - } - - private updateGroupKinds(category: CatalogCategory) { this.groupKinds .getOrInsert(category.spec.group, ExtendedMap.new) .strictSet(category.spec.names.kind, category); + + return () => { + this.categories.delete(category); + this.groupKinds.get(category.spec.group).delete(category.spec.names.kind); + }; } @computed get items() {