Skip to content

Commit

Permalink
fix(registries): handle loading state for 2 queries separately in Pan…
Browse files Browse the repository at this point in the history
…elHistogramInner (#2540)

* separate loading state checks for queries in panel
  • Loading branch information
ibindlish authored Oct 1, 2024
1 parent 88f4903 commit 54de4fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion weave-js/src/components/Panel2/PanelStringHistogram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 54de4fe

Please sign in to comment.