From 5ff2c6941c7e753753098b9554d2491896a80b66 Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" Date: Wed, 19 May 2021 15:44:25 +0300 Subject: [PATCH] Clean at the upstream line 41 Signed-off-by: Hung-Han (Henry) Chen --- src/renderer/api/catalog-entity-registry.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/renderer/api/catalog-entity-registry.ts b/src/renderer/api/catalog-entity-registry.ts index 587b50a204..9dae073cf5 100644 --- a/src/renderer/api/catalog-entity-registry.ts +++ b/src/renderer/api/catalog-entity-registry.ts @@ -38,7 +38,7 @@ export class CatalogEntityRegistry { } @action updateItems(items: (CatalogEntityData & CatalogEntityKindData)[]) { - this._items = items.map(data => this.categoryRegistry.getEntityForData(data)); + this._items = items.map(data => this.categoryRegistry.getEntityForData(data)).filter(Boolean); } set activeEntity(entity: CatalogEntity) { @@ -65,9 +65,7 @@ export class CatalogEntityRegistry { getItemsForCategory(category: CatalogCategory): T[] { const supportedVersions = category.spec.versions.map((v) => `${category.spec.group}/${v.name}`); - const items = this._items - .filter(Boolean) - .filter((item) => supportedVersions.includes(item.apiVersion) && item.kind === category.spec.names.kind); + const items = this._items.filter((item) => supportedVersions.includes(item.apiVersion) && item.kind === category.spec.names.kind); return items as T[]; }