From 4bd6b19631483e8676eb1ed2d53fc11352b250ea Mon Sep 17 00:00:00 2001 From: Egor Berezovskiy Date: Thu, 5 Dec 2024 16:35:38 +0100 Subject: [PATCH] front: fix lmr max speed prefill Signed-off-by: Egor Berezovskiy --- front/src/applications/stdcm/hooks/useStdcmConsist.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/applications/stdcm/hooks/useStdcmConsist.ts b/front/src/applications/stdcm/hooks/useStdcmConsist.ts index cf738661b30..c598fce4fc4 100644 --- a/front/src/applications/stdcm/hooks/useStdcmConsist.ts +++ b/front/src/applications/stdcm/hooks/useStdcmConsist.ts @@ -8,7 +8,7 @@ import { useOsrdConfActions, useOsrdConfSelectors } from 'common/osrdContext'; import { type StdcmConfSliceActions } from 'reducers/osrdconf/stdcmConf'; import type { StdcmConfSelectors } from 'reducers/osrdconf/stdcmConf/selectors'; import { useAppDispatch } from 'store'; -import { kgToT } from 'utils/physics'; +import { kgToT, msToKmh } from 'utils/physics'; const useStdcmConsist = () => { const dispatch = useAppDispatch(); @@ -59,7 +59,7 @@ const useStdcmConsist = () => { if (!maxSpeedChanged) { const consistMaxSpeed = min([rollingStock?.max_speed, towed?.max_speed]); - dispatch(updateMaxSpeed(consistMaxSpeed ? Math.floor(consistMaxSpeed) : undefined)); + dispatch(updateMaxSpeed(consistMaxSpeed ? Math.floor(msToKmh(consistMaxSpeed)) : undefined)); } };