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 <theo_crosbie@yahoo.fr>
  • Loading branch information
theocrsb committed Jan 8, 2025
1 parent cf75a59 commit 16e4ada
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 16e4ada

Please sign in to comment.