Fix : Problems related to measurement operation undo (#5541)
fixed the console error while undoing a removed annotation
This commit is contained in:
parent
74c92fa601
commit
2481208f31
@ -503,11 +503,15 @@ const connectMeasurementServiceToTools = ({
|
|||||||
}
|
}
|
||||||
const removedAnnotation = annotation.state.getAnnotation(removedMeasurementId);
|
const removedAnnotation = annotation.state.getAnnotation(removedMeasurementId);
|
||||||
removeAnnotation(removedMeasurementId);
|
removeAnnotation(removedMeasurementId);
|
||||||
commandsManager.run('triggerCreateAnnotationMemo', {
|
// Ensure `removedAnnotation` is available before triggering the memo,
|
||||||
annotation: removedAnnotation,
|
// as it can be undefined during an undo operation
|
||||||
FrameOfReferenceUID: removedAnnotation.metadata.FrameOfReferenceUID,
|
if (removedAnnotation) {
|
||||||
options: { deleting: true },
|
commandsManager.run('triggerCreateAnnotationMemo', {
|
||||||
});
|
annotation: removedAnnotation,
|
||||||
|
FrameOfReferenceUID: removedAnnotation.metadata.FrameOfReferenceUID,
|
||||||
|
options: { deleting: true },
|
||||||
|
});
|
||||||
|
}
|
||||||
const renderingEngine = cornerstoneViewportService.getRenderingEngine();
|
const renderingEngine = cornerstoneViewportService.getRenderingEngine();
|
||||||
// Note: We could do a better job by triggering the render on the
|
// Note: We could do a better job by triggering the render on the
|
||||||
// viewport itself, but the removeAnnotation does not include that info...
|
// viewport itself, but the removeAnnotation does not include that info...
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user