diff --git a/platform/viewer/src/components/Labelling/LabellingFlow.js b/platform/viewer/src/components/Labelling/LabellingFlow.js index d516b3173..c2749431e 100644 --- a/platform/viewer/src/components/Labelling/LabellingFlow.js +++ b/platform/viewer/src/components/Labelling/LabellingFlow.js @@ -27,26 +27,25 @@ const LabellingFlow = ({ skipAddLabelButton, }); - const initialItems = OHIFLabellingData; - const currentItems = cloneDeep(initialItems); - useEffect(() => { - const treatMeasurementData = measurementData => { - if (editDescription) { - measurementData.description = undefined; - } - - if (editLocation) { - measurementData.location = undefined; - } - }; - const newMeasurementData = cloneDeep(measurementData); - treatMeasurementData(newMeasurementData); + + if (editDescription) { + newMeasurementData.description = undefined; + } + + if (editLocation) { + newMeasurementData.location = undefined; + } + + let newEditLocation = editLocation; + if (!editDescription && !editLocation) { + newEditLocation = true; + } setState(state => ({ ...state, - editLocation: !editDescription && !editLocation, + editLocation: newEditLocation, measurementData: newMeasurementData, })); }, [editDescription, editLocation, measurementData]); @@ -151,7 +150,7 @@ const LabellingFlow = ({ if (editLocation) { return (