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 8, 2025
1 parent a0e64c5 commit f0ac376
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 f0ac376

Please sign in to comment.