mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
simplify fix
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
3bdb3dfba9
commit
8c8bb94e0f
@ -121,7 +121,10 @@ export class NamespaceSelectFilter extends React.Component<SelectProps> {
|
|||||||
namespaceStore.toggleSingle(namespace);
|
namespaceStore.toggleSingle(namespace);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
namespaceStore.selectAll();
|
/**
|
||||||
|
* WARNING: only ever call this method with `false` as an argument
|
||||||
|
*/
|
||||||
|
namespaceStore.toggleAll(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -149,7 +149,7 @@ export class NamespaceStore extends KubeObjectStore<Namespace> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@computed get hasAllContexts(): boolean {
|
@computed get hasAllContexts(): boolean {
|
||||||
return this.contextNamespaces.length === this.allowedNamespaces.length;
|
return this.selectedNamespaces.length === this.allowedNamespaces.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
@ -167,18 +167,8 @@ export class NamespaceStore extends KubeObjectStore<Namespace> {
|
|||||||
this.selectNamespaces(namespace);
|
this.selectNamespaces(namespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
|
||||||
selectAll() {
|
|
||||||
this.selectNamespaces([]); // Empty array means "all"
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated This function is broken, `showAll` is opposite of what
|
|
||||||
*/
|
|
||||||
@action
|
@action
|
||||||
toggleAll(showAll?: boolean) {
|
toggleAll(showAll?: boolean) {
|
||||||
console.warn("NamespaceStore.toggleAll is deprecated. Use selectAll");
|
|
||||||
|
|
||||||
if (typeof showAll === "boolean") {
|
if (typeof showAll === "boolean") {
|
||||||
if (showAll) {
|
if (showAll) {
|
||||||
this.selectNamespaces(this.allowedNamespaces);
|
this.selectNamespaces(this.allowedNamespaces);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user