Skip to content

Commit

Permalink
fix rendering issue by running loadSR before updateSR
Browse files Browse the repository at this point in the history
  • Loading branch information
Joeycho committed Jun 11, 2024
1 parent 727088f commit c4f6e5e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

/**
Expand Down

0 comments on commit c4f6e5e

Please sign in to comment.