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

ensure namespace placeholder reflects what will be saved to local storage (#4176)

This commit is contained in:
Jim Ehrismann 2021-10-29 08:42:42 -04:00 committed by GitHub
parent 860f6e2e6d
commit 8cbb4c29d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,15 +37,15 @@ const Placeholder = observer((props: PlaceholderProps<any, boolean>) => {
const getPlaceholder = (): React.ReactNode => {
const namespaces = namespaceStore.contextNamespaces;
switch (namespaces.length) {
case 0:
case namespaceStore.allowedNamespaces.length:
if (!namespaceStore.selectedNamespaces.length || !namespaces.length) {
return <>All namespaces</>;
case 1:
return <>Namespace: {namespaces[0]}</>;
default:
return <>Namespaces: {namespaces.join(", ")}</>;
}
if (namespaces.length === 1) {
return <>Namespace: {namespaces[0]}</>;
}
return <>Namespaces: {namespaces.join(", ")}</>;
};
return (