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 fe37836 commit 27f0e05
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 @@ -124,7 +124,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 27f0e05

Please sign in to comment.