Skip to content

Commit

Permalink
[Mission] Résolution du bug de suppression de contrôle (#1502)
Browse files Browse the repository at this point in the history
## Related Pull Requests & Issues

- Resolve #1468

----

- [ ] Tests E2E (Cypress)
  • Loading branch information
claire2212 committed Jun 24, 2024
2 parents 69d4de6 + b15ac93 commit c21fe35
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,20 @@ export const useUpdateMissionZone = (sortedActions: Array<ActionsTypeForTimeLine
// for control action we need to compute a circle for mission zone
if (firstActionWithDate.actionType === ActionTypeEnum.CONTROL) {
const { coordinates } = firstActionWithDate.geom
if (coordinates.length === 0) {
return
if (coordinates.length > 0) {
const circleZone = computeCircleZone(coordinates[0])

if (isEqual(values.geom, circleZone)) {
return
}
setFieldValue('geom', circleZone)
}
const circleZone = computeCircleZone(coordinates[0])
setFieldValue('geom', circleZone)
}

if (firstActionWithDate.actionType === ActionTypeEnum.SURVEILLANCE) {
if (isEqual(values.geom, firstActionWithDate.geom)) {
return
}
setFieldValue('geom', firstActionWithDate.geom)
}

Expand Down

0 comments on commit c21fe35

Please sign in to comment.