Fix: don't remove clear all of groupKinds when running disposer

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-05-20 10:19:40 -04:00
1 parent 99a0361f1a
commit 6964790f05
1 file changed
+5 -9
@@ -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() {