Skip to content

Commit

Permalink
front: fix duplicate op in timestops inputs
Browse files Browse the repository at this point in the history
comparing ops and pathsteps with their uic and ch code is sometimes not enough.
compare them also with position on path to differenciate them.

Signed-off-by: theocrsb <[email protected]>
  • Loading branch information
theocrsb committed Jan 9, 2025
1 parent 6f2bbd4 commit 324cd16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion front/src/modules/pathfinding/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ export const upsertPathStepsInOPs = (ops: SuggestedOP[], pathSteps: PathStep[]):
}
} else {
updatedOPs = updatedOPs.map((op) => {
if (matchPathStepAndOp(step, op) && op.kp === step.kp) {
if (
matchPathStepAndOp(step, op) &&
op.kp === step.kp &&
step.positionOnPath === op.positionOnPath
) {
return {
...op,
pathStepId: step.id,
Expand Down

0 comments on commit 324cd16

Please sign in to comment.