diff --git a/src/renderer/components/+namespaces/namespace-select-filter.tsx b/src/renderer/components/+namespaces/namespace-select-filter.tsx index 5863e4244f..27f3ac959f 100644 --- a/src/renderer/components/+namespaces/namespace-select-filter.tsx +++ b/src/renderer/components/+namespaces/namespace-select-filter.tsx @@ -121,7 +121,7 @@ export class NamespaceSelectFilter extends React.Component { namespaceStore.toggleSingle(namespace); } } else { - namespaceStore.toggleAll(true); // "All namespaces" clicked + namespaceStore.selectAll(); } }; diff --git a/src/renderer/components/+namespaces/namespace.store.ts b/src/renderer/components/+namespaces/namespace.store.ts index 54f98702fc..7eb9fa2256 100644 --- a/src/renderer/components/+namespaces/namespace.store.ts +++ b/src/renderer/components/+namespaces/namespace.store.ts @@ -149,7 +149,7 @@ export class NamespaceStore extends KubeObjectStore { } @computed get hasAllContexts(): boolean { - return this.selectedNamespaces.length === this.allowedNamespaces.length; + return this.contextNamespaces.length === this.allowedNamespaces.length; } @action @@ -167,8 +167,18 @@ export class NamespaceStore extends KubeObjectStore { this.selectNamespaces(namespace); } + @action + selectAll() { + this.selectNamespaces([]); // Empty array means "all" + } + + /** + * @deprecated This function is broken, `showAll` is opposite of what + */ @action toggleAll(showAll?: boolean) { + console.warn("NamespaceStore.toggleAll is deprecated. Use selectAll"); + if (typeof showAll === "boolean") { if (showAll) { this.selectNamespaces(this.allowedNamespaces);