From 174bba98d78ac8de5700938e0a641de1cc250e13 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Wed, 17 Feb 2021 22:28:33 +0200 Subject: [PATCH] Fix isLoadingAll within KubeObjectStore.loadItems (#2174) * fix isLoadingAll within KubeObjectStore.loadItems Signed-off-by: Jari Kolehmainen * fix isLoadingAll within KubeObjectStore.loadItems Signed-off-by: Jari Kolehmainen --- src/renderer/kube-object.store.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/kube-object.store.ts b/src/renderer/kube-object.store.ts index 023048cb73..987112a25c 100644 --- a/src/renderer/kube-object.store.ts +++ b/src/renderer/kube-object.store.ts @@ -109,9 +109,11 @@ export abstract class KubeObjectStore extends ItemSt return api.list({}, this.query); } - const isLoadingAll = this.context.allNamespaces.every(ns => namespaces.includes(ns)); + const isLoadingAll = this.context.allNamespaces?.length > 1 + && this.context.cluster.accessibleNamespaces.length === 0 + && this.context.allNamespaces.every(ns => namespaces.includes(ns)); - if (isLoadingAll && this.context.cluster.accessibleNamespaces.length === 0) { + if (isLoadingAll) { this.loadedNamespaces = []; return api.list({}, this.query);