From 27f0e05353b1e99797f99e53af82d3405dcfbe75 Mon Sep 17 00:00:00 2001 From: theocrsb Date: Wed, 8 Jan 2025 09:24:24 +0100 Subject: [PATCH] front: fix duplicate op in timestops inputs 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 --- front/src/modules/pathfinding/utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/front/src/modules/pathfinding/utils.ts b/front/src/modules/pathfinding/utils.ts index 0ede09223d5..29613489b36 100644 --- a/front/src/modules/pathfinding/utils.ts +++ b/front/src/modules/pathfinding/utils.ts @@ -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,