1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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 2021-05-20 10:19:40 -04:00
parent 99a0361f1a
commit 6964790f05

View File

@ -29,18 +29,14 @@ export class CatalogCategoryRegistry {
@action add(category: CatalogCategory): Disposer { @action add(category: CatalogCategory): Disposer {
this.categories.add(category); this.categories.add(category);
this.updateGroupKinds(category);
return () => {
this.categories.delete(category);
this.groupKinds.clear();
};
}
private updateGroupKinds(category: CatalogCategory) {
this.groupKinds this.groupKinds
.getOrInsert(category.spec.group, ExtendedMap.new) .getOrInsert(category.spec.group, ExtendedMap.new)
.strictSet(category.spec.names.kind, category); .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() { @computed get items() {