Bug fix after delete last wo marker entry is updating same rating
This commit is contained in:
parent
98df5a2825
commit
18a31e4c2a
@ -41,9 +41,11 @@ const PatientImageMarker = (props: Props) => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (action.type === 'add')
|
||||
setEntries([...entries, { index: entries.length + 1, severity: 5 }]);
|
||||
else
|
||||
if (action.type === 'add') {
|
||||
const ind =
|
||||
entries.length != 0 ? entries[entries.length - 1].index + 1 : 1;
|
||||
setEntries([...entries, { index: ind, severity: 5 }]);
|
||||
} else
|
||||
setEntries(
|
||||
entries.filter((entry: any, ind: number) => ind != action.index)
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user