From 6964790f05d808b71c46d2787bce8249c9816cb9 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Thu, 20 May 2021 10:19:40 -0400 Subject: [PATCH] Fix: don't remove clear all of groupKinds when running disposer Signed-off-by: Sebastian Malton --- src/common/catalog/catalog-category-registry.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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() {