Skip to content

Commit 5b6883e

Browse files
fix(app): replace index variables in input image node before obtaining class labels (#3850)
1 parent e6cc093 commit 5b6883e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

weave-js/src/components/Panel2/PanelImage.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ const PanelImageConfig: FC<PanelImageProps> = ({
7979
updateConfig,
8080
input,
8181
}) => {
82-
const classLabels = useClassLabels(input);
82+
const weave = useWeaveContext();
83+
84+
const exemplarsNode = useMemo(() => {
85+
return replaceInputVariables(input, weave.client.opStore);
86+
}, [input, weave.client.opStore]);
87+
88+
const classLabels = useClassLabels(exemplarsNode as Node<typeof inputType>);
8389

8490
const {classSets, controls} = Controls.useImageControls(
8591
input.type,
@@ -97,12 +103,6 @@ const PanelImageConfig: FC<PanelImageProps> = ({
97103
}
98104
}, [config, controls]);
99105

100-
const weave = useWeaveContext();
101-
102-
const exemplarsNode = useMemo(() => {
103-
return replaceInputVariables(input, weave.client.opStore);
104-
}, [input, weave.client.opStore]);
105-
106106
const exemplars = CGReact.useNodeValue(exemplarsNode).result;
107107
const boxes = useMemo(() => {
108108
if (exemplars == null) {

0 commit comments

Comments
 (0)