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

Observe selectedSegmentation changes to refresh segment list

✅ Closes: #1669
This commit is contained in:
Igor Octaviano authored and GitHub committed 2020-04-27 10:39:11 +02:00
1 parent 561911056a
commit 20e366ffbd
1 file changed
+2 -6
@@ -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}
/>