Skip to content

Commit

Permalink
front: fix stdcm consist warning
Browse files Browse the repository at this point in the history
Signed-off-by: SharglutDev <[email protected]>
  • Loading branch information
SharglutDev committed Jan 16, 2025
1 parent 77ca813 commit c9066aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions front/src/applications/stdcm/utils/consistValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand All @@ -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';
}

Expand Down

0 comments on commit c9066aa

Please sign in to comment.