fix(sr): rendering issue by running loadSR before updateSR (#4226)

This commit is contained in:
Joeycho authored and GitHub committed 2024-06-12 14:57:38 -04:00
1 parent a97666ea4e
commit 6971287460
1 file changed
+7 -1
@@ -270,17 +270,23 @@ function OHIFCornerstoneSRViewport(props: withAppTypes) {
updateViewport(measurementSelected);
};
loadSR();
}, [dataSource, srDisplaySet]);
}, [srDisplaySet]);
/**
* Hook to update the tracking identifiers when the selected measurement changes or
* the element changes
*/
useEffect(() => {
const updateSR = async () => {
if (!srDisplaySet.isLoaded) {
await srDisplaySet.load();
}
if (!element || !srDisplaySet.isLoaded) {
return;
}
setTrackingIdentifiers(measurementSelected);
}
updateSR();
}, [measurementSelected, element, setTrackingIdentifiers, srDisplaySet]);
/**