From e8a93788b03b3efb67ef8b75da4c6a9004c89c0d Mon Sep 17 00:00:00 2001 From: Jim Ehrismann Date: Thu, 28 Oct 2021 14:56:30 -0400 Subject: [PATCH] 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 --- .../components/+namespaces/namespace-select-filter.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/+namespaces/namespace-select-filter.tsx b/src/renderer/components/+namespaces/namespace-select-filter.tsx index 436f0a8a80..a490183d7c 100644 --- a/src/renderer/components/+namespaces/namespace-select-filter.tsx +++ b/src/renderer/components/+namespaces/namespace-select-filter.tsx @@ -36,10 +36,10 @@ import { isMac } from "../../../common/vars"; const Placeholder = observer((props: PlaceholderProps) => { 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]};