Fix: don't remove clear all of groupKinds when running disposer (#2835)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-05-28 09:10:01 -04:00
1 parent 9f1e262310
commit 847ba3f8eb
2 files changed
+80 -9

No files matched your search

@@ -33,18 +33,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() {