fix(cornerstoneCache):Race condition on cache notification (#2900)
This commit is contained in:
1 parent
9df557831b
commit
06feca1f4a
3 files changed
+17
-13
No files matched your search
@@ -232,22 +232,22 @@ const OHIFCornerstoneViewport = React.memo(props => {
|
||||
}
|
||||
|
||||
const loadViewportData = async () => {
|
||||
const viewportData = await CornerstoneCacheService.getViewportData(
|
||||
await CornerstoneCacheService.getViewportData(
|
||||
viewportIndex,
|
||||
displaySets,
|
||||
viewportOptions.viewportType,
|
||||
dataSource,
|
||||
(viewportDataLoaded) => {
|
||||
CornerstoneViewportService.setViewportDisplaySets(
|
||||
viewportIndex,
|
||||
viewportDataLoaded,
|
||||
viewportOptions,
|
||||
displaySetOptions
|
||||
);
|
||||
setViewportData(viewportDataLoaded);
|
||||
},
|
||||
initialImageIndex
|
||||
);
|
||||
|
||||
CornerstoneViewportService.setViewportDisplaySets(
|
||||
viewportIndex,
|
||||
viewportData,
|
||||
viewportOptions,
|
||||
displaySetOptions
|
||||
);
|
||||
|
||||
setViewportData(viewportData);
|
||||
};
|
||||
|
||||
loadViewportData();
|
||||
|
||||
@@ -137,7 +137,7 @@ function ViewportOrientationMarkers({
|
||||
}
|
||||
|
||||
const imageIndex = imageSliceData.imageIndex;
|
||||
const imageId = viewportData?.imageIds[imageIndex];
|
||||
const imageId = viewportData.imageIds?.[imageIndex];
|
||||
|
||||
// Workaround for below TODO stub
|
||||
if (!imageId) {
|
||||
|
||||
Reference in new issue
Block a user