1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

ensure namespace selector placeholder reflects what will be saved to local storage

If all of the namespaces have been manually selected by the user then those
namespaces are explicitly saved to the namespace store (not [], representing
all namespaces). Thus the placeholder in the selector should show this list,
not "All namespaces".

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann 2021-10-28 14:56:30 -04:00
parent a9b9c87d1f
commit e8a93788b0

View File

@ -36,10 +36,10 @@ import { isMac } from "../../../common/vars";
const Placeholder = observer((props: PlaceholderProps<any, boolean>) => {
const getPlaceholder = (): React.ReactNode => {
const namespaces = namespaceStore.contextNamespaces;
const length = namespaceStore.selectedNamespaces.length ? namespaces.length : 0;
switch (namespaces.length) {
switch (length) {
case 0:
case namespaceStore.allowedNamespaces.length:
return <>All namespaces</>;
case 1:
return <>Namespace: {namespaces[0]}</>;