From c9066aaa304e75bf8c2db7bbe11d62e364dc4281 Mon Sep 17 00:00:00 2001
From: SharglutDev
Date: Thu, 16 Jan 2025 15:03:09 +0100
Subject: [PATCH] front: fix stdcm consist warning
Signed-off-by: SharglutDev
---
front/src/applications/stdcm/utils/consistValidation.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/front/src/applications/stdcm/utils/consistValidation.ts b/front/src/applications/stdcm/utils/consistValidation.ts
index e82c20a3370..711986698d7 100644
--- a/front/src/applications/stdcm/utils/consistValidation.ts
+++ b/front/src/applications/stdcm/utils/consistValidation.ts
@@ -25,7 +25,7 @@ export const validateTotalMass = ({
const consistMassInTons = Math.floor(kgToT(tractionEngineMass + towedMass));
const massLimit = towedMass ? consistMassInTons : tractionMassInTons;
- if (totalMass < massLimit || totalMass >= CONSIST_TOTAL_MASS_MAX) {
+ if (totalMass < massLimit || totalMass > CONSIST_TOTAL_MASS_MAX) {
return 'consist.errors.totalMass.range';
}
@@ -51,7 +51,7 @@ export const validateTotalLength = ({
const consistLength = Math.floor(tractionEngineLength + towedLength);
- if (totalLength < consistLength || totalLength >= CONSIST_TOTAL_LENGTH_MAX) {
+ if (totalLength < consistLength || totalLength > CONSIST_TOTAL_LENGTH_MAX) {
return 'consist.errors.totalLength.range';
}