From 4ffd4567c53483115c5fc19b8d69a7042fb1fa0e Mon Sep 17 00:00:00 2001 From: tejhan-diallo Date: Wed, 3 Jun 2026 20:06:18 -0400 Subject: [PATCH] upstreamable: fix: resolve infinite loading in Map when resource API is unavailable Signed-off-by: tejhan-diallo --- .../components/resourceMap/sources/definitions/sources.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/resourceMap/sources/definitions/sources.tsx b/frontend/src/components/resourceMap/sources/definitions/sources.tsx index 6142a40a9..6d6540b97 100644 --- a/frontend/src/components/resourceMap/sources/definitions/sources.tsx +++ b/frontend/src/components/resourceMap/sources/definitions/sources.tsx @@ -61,9 +61,12 @@ const makeKubeSource = (cl: KubeObjectClass): GraphSource => ({ label: cl.apiName, icon: , useData() { - const [items] = cl.useList({ namespace: useNamespaces() }); + const [items, error] = cl.useList({ namespace: useNamespaces() }); - return useMemo(() => (items ? { nodes: items?.map(makeKubeObjectNode) } : null), [items]); + return useMemo( + () => (items ? { nodes: items?.map(makeKubeObjectNode) } : error ? { nodes: [] } : null), + [items, error] + ); }, });