fix: 🐛 Dropdown not updating when selecting segment (#1675)

Observe selectedSegmentation changes to refresh segment list

 Closes: #1669
This commit is contained in:
Igor Octaviano 2020-04-27 05:39:11 -03:00 committed by GitHub
parent 561911056a
commit 20e366ffbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,7 @@ const SegmentationPanel = ({
segmentList: [],
}));
}
}, [studies, viewports, activeIndex, getLabelmapList, getSegmentList]);
}, [studies, viewports, activeIndex, getLabelmapList, getSegmentList, state.selectedSegmentation]);
/* Handle open/closed panel behaviour */
useEffect(() => {
@ -424,11 +424,7 @@ const SegmentationPanel = ({
<h3>Segmentations</h3>
<div className="segmentations">
<SegmentationSelect
value={
state.labelmapList.find(
i => i.value === state.selectedSegmentation
) || null
}
value={state.labelmapList.find(i => i.value === state.selectedSegmentation)}
formatOptionLabel={SegmentationItem}
options={state.labelmapList}
/>