From d2c2dee14bea0bb6be25efc2c555f0c94ba5503a Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 17 Sep 2026 16:29:47 -0400 Subject: [PATCH 1/2] fix: handle non-Immutable FLAGS in getFlagsObject Signed-off-by: Atif Ali --- src/plugin/utils/useClusterVersion.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin/utils/useClusterVersion.tsx b/src/plugin/utils/useClusterVersion.tsx index a5a95c68b..5773f68a4 100644 --- a/src/plugin/utils/useClusterVersion.tsx +++ b/src/plugin/utils/useClusterVersion.tsx @@ -32,7 +32,7 @@ export type FlagsObject = { [key: string]: boolean }; export const getFlagsObject = ({ [featureReducerName]: featureState, -}: RootStateOrAny): FlagsObject => featureState.toObject(); +}: RootStateOrAny): FlagsObject => featureState?.toObject?.() ?? featureState; const getClusterVersionFlag = (state: RootStateOrAny) => getFlagsObject(state)?.['CLUSTER_VERSION']; From 45856696bff34ec0711d3e0cc1634f189ae09d88 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 17 Sep 2026 17:45:20 -0400 Subject: [PATCH 2/2] fix error state.UI.get is not a function Signed-off-by: Atif Ali --- .../AllNamespaces/useShowOperandsInAllNamespaces.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gitops/components/shared/AllNamespaces/useShowOperandsInAllNamespaces.ts b/src/gitops/components/shared/AllNamespaces/useShowOperandsInAllNamespaces.ts index ff535b349..8c14bd1a1 100644 --- a/src/gitops/components/shared/AllNamespaces/useShowOperandsInAllNamespaces.ts +++ b/src/gitops/components/shared/AllNamespaces/useShowOperandsInAllNamespaces.ts @@ -6,9 +6,12 @@ type UseShowOperandsInAllNamespaces = () => [boolean, (value: boolean) => void]; // This hook can be used to consume and update the showOperandsInAllNamespaces redux state export const useShowOperandsInAllNamespaces: UseShowOperandsInAllNamespaces = () => { const dispatch = useDispatch(); - const showOperandsInAllNamespaces = useSelector((state: RootStateOrAny) => - state.UI.get('showOperandsInAllNamespaces'), - ); + const showOperandsInAllNamespaces = useSelector((state: RootStateOrAny) => { + const ui = state.UI; + return typeof ui?.get === 'function' + ? ui.get('showOperandsInAllNamespaces') + : ui?.showOperandsInAllNamespaces; + }); const setShowOperandsInAllNamespaces = useCallback( (value: boolean) => dispatch(uiActionsSetShowOperandsInAllNamespaces(value)), [dispatch],