From 54de4fed8be929501443035fe5b09ff534421a74 Mon Sep 17 00:00:00 2001 From: Ishita Bindlish Date: Tue, 1 Oct 2024 16:02:58 -0700 Subject: [PATCH] fix(registries): handle loading state for 2 queries separately in PanelHistogramInner (#2540) * separate loading state checks for queries in panel --- weave-js/src/components/Panel2/PanelStringHistogram.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weave-js/src/components/Panel2/PanelStringHistogram.tsx b/weave-js/src/components/Panel2/PanelStringHistogram.tsx index 9bf8fccb54b6..9226bf2c6de6 100644 --- a/weave-js/src/components/Panel2/PanelStringHistogram.tsx +++ b/weave-js/src/components/Panel2/PanelStringHistogram.tsx @@ -169,7 +169,12 @@ const PanelStringHistogramInner: React.FC< const isColorable = colorNode.nodeType !== 'void'; const nodeValueQuery = CGReact.useNodeValue(props.input); const data = useMemo(() => { - if (nodeValueQuery.loading || (isColorable && colorNodeValue.loading)) { + const shouldEject = [ + nodeValueQuery.loading, + isColorable && colorNodeValue.loading, + nodeValueQuery.result == null, + ].some(Boolean); + if (shouldEject) { return []; } if (!isColorable) {