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 committed 2021-10-28 14:57:16 -04:00
1 parent a9b9c87d1f
commit e8a93788b0
1 file changed
+2 -2
@@ -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]}</>;