From 3d92ef1480e5550fb114ee8df17794bf356a5b0c Mon Sep 17 00:00:00 2001 From: Achraf Mohyeddine Date: Fri, 13 Dec 2024 11:30:10 +0100 Subject: [PATCH] front: reset stdcm config slice Signed-off-by: Achraf Mohyeddine --- .../applications/stdcm/components/StdcmForm/StdcmConfig.tsx | 4 ++-- front/src/reducers/osrdconf/stdcmConf/index.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/front/src/applications/stdcm/components/StdcmForm/StdcmConfig.tsx b/front/src/applications/stdcm/components/StdcmForm/StdcmConfig.tsx index c5e9d710901..3f2dd5bbbfb 100644 --- a/front/src/applications/stdcm/components/StdcmForm/StdcmConfig.tsx +++ b/front/src/applications/stdcm/components/StdcmForm/StdcmConfig.tsx @@ -58,7 +58,7 @@ const StdcmConfig = ({ updateGridMarginBefore, updateStdcmStandardAllowance, updateStdcmPathStep, - resetStdcmPathSteps, + resetStdcmConfig, } = useOsrdConfActions() as StdcmConfSliceActions; const { @@ -141,7 +141,7 @@ const StdcmConfig = ({ }, [infra]); useEffect(() => { - dispatch(resetStdcmPathSteps()); + dispatch(resetStdcmConfig()); }, []); return ( diff --git a/front/src/reducers/osrdconf/stdcmConf/index.ts b/front/src/reducers/osrdconf/stdcmConf/index.ts index 340ae815657..2dc46859225 100644 --- a/front/src/reducers/osrdconf/stdcmConf/index.ts +++ b/front/src/reducers/osrdconf/stdcmConf/index.ts @@ -157,9 +157,6 @@ export const stdcmConfSlice = createSlice({ ); state.stdcmPathSteps = newPathSteps; }, - resetStdcmPathSteps(state: Draft) { - state.stdcmPathSteps = stdcmConfInitialState.stdcmPathSteps; - }, addStdcmVia(state: Draft, action: PayloadAction) { // Index takes count of the origin in the array