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);
|
||||
removeAnnotation(removedMeasurementId);
|
||||
commandsManager.run('triggerCreateAnnotationMemo', {
|
||||
annotation: removedAnnotation,
|
||||
FrameOfReferenceUID: removedAnnotation.metadata.FrameOfReferenceUID,
|
||||
options: { deleting: true },
|
||||
});
|
||||
// Ensure `removedAnnotation` is available before triggering the memo,
|
||||
// as it can be undefined during an undo operation
|
||||
if (removedAnnotation) {
|
||||
commandsManager.run('triggerCreateAnnotationMemo', {
|
||||
annotation: removedAnnotation,
|
||||
FrameOfReferenceUID: removedAnnotation.metadata.FrameOfReferenceUID,
|
||||
options: { deleting: true },
|
||||
});
|
||||
}
|
||||
const renderingEngine = cornerstoneViewportService.getRenderingEngine();
|
||||
// Note: We could do a better job by triggering the render on the
|
||||
// viewport itself, but the removeAnnotation does not include that info...
|
||||
|
||||
Loading…
Reference in New Issue
Block a user