diff --git a/src/renderer/components/+namespaces/namespace-select-filter.tsx b/src/renderer/components/+namespaces/namespace-select-filter.tsx index 27f3ac959f..436f0a8a80 100644 --- a/src/renderer/components/+namespaces/namespace-select-filter.tsx +++ b/src/renderer/components/+namespaces/namespace-select-filter.tsx @@ -121,7 +121,10 @@ export class NamespaceSelectFilter extends React.Component { namespaceStore.toggleSingle(namespace); } } else { - namespaceStore.selectAll(); + /** + * WARNING: only ever call this method with `false` as an argument + */ + namespaceStore.toggleAll(false); } }; diff --git a/src/renderer/components/+namespaces/namespace.store.ts b/src/renderer/components/+namespaces/namespace.store.ts index 7eb9fa2256..54f98702fc 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.contextNamespaces.length === this.allowedNamespaces.length; + return this.selectedNamespaces.length === this.allowedNamespaces.length; } @action @@ -167,18 +167,8 @@ 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);