Skip to content

Commit

Permalink
fixup! front: fix train on map (ts v2)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarani committed Jul 1, 2024
1 parent f85e791 commit 80cd712
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const getSelectedTrainHoverPositions = (
geojsonPath: Feature<LineString>,
positionValues: PositionsSpeedTimes<Date>,
trainId: number
): TrainCurrentInfo | null => {
): TrainCurrentInfo | undefined => {
const { headPosition, tailPosition } = positionValues;

if (headPosition === undefined || tailPosition === undefined) {
return null;
return undefined;
}

const headDistanceAlong = mToKm(headPosition.position);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const SimulationResultMapV2: FC<MapProps> = ({ geometry, trainSimulation }) => {
positionValues,
trainSimulation.trainId
);
if (selectedTrainPosition) setSelectedTrainHoverPosition(selectedTrainPosition);
setSelectedTrainHoverPosition(selectedTrainPosition);
}
},
'simulation-result-map',
Expand Down

0 comments on commit 80cd712

Please sign in to comment.