File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,11 @@ export const StationMarker = ({ station }: StationMarkerProps) => {
3838 const { colorScheme } = useMantineColorScheme ( ) ;
3939
4040 let botIcon = "/markers/icon-bot-simrail.jpg" ;
41- if ( colorScheme === "dark" || colorScheme === "auto" && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches )
41+ if (
42+ colorScheme === "dark" ||
43+ ( colorScheme === "auto" &&
44+ window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches )
45+ )
4246 botIcon = "/markers/icon-bot-simrail-dark.jpg" ;
4347
4448 const icon = L . icon ( {
Original file line number Diff line number Diff line change @@ -33,9 +33,12 @@ const TrainMarker = ({ train }: TrainMarkerProps) => {
3333
3434 const { colorScheme } = useMantineColorScheme ( ) ;
3535
36-
3736 let botIcon = "/markers/icon-bot-simrail.jpg" ;
38- if ( colorScheme === "dark" || colorScheme === "auto" && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches )
37+ if (
38+ colorScheme === "dark" ||
39+ ( colorScheme === "auto" &&
40+ window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches )
41+ )
3942 botIcon = "/markers/icon-bot-simrail-dark.jpg" ;
4043
4144 const icon = L . icon ( {
Original file line number Diff line number Diff line change @@ -138,6 +138,8 @@ const TrainText = ({
138138 // only the first unit is responsible for train traction at the moment, so this is just safe to assume // Not true anymore,-
139139 // don't think it was true before update either as EMUs prob had multiple traction
140140
141+ const roundedSpeed = Math . round ( train . TrainData . Velocity ) ;
142+
141143 // however, this might be wrong in case the first unit is not yet registered in railcars.json, so we just
142144 // fall back to displaying the raw api name in that case
143145 const tractionUnit = locomotives . at ( 0 ) ;
@@ -242,8 +244,17 @@ const TrainText = ({
242244 { ! minified && < Title order = { 3 } > Route </ Title > }
243245 { train . StartStation } - { train . EndStation }
244246 < br />
245- Speed: { Math . round ( train . TrainData . Velocity ) } km/h
246- < br />
247+ { roundedSpeed === 0 ? (
248+ < >
249+ Train currently stopped
250+ < br />
251+ </ >
252+ ) : (
253+ < >
254+ Speed: { roundedSpeed } km/h
255+ < br />
256+ </ >
257+ ) }
247258 Vmax: { minMaxSpeed } km/h
248259 < br />
249260 { ! minified && (
You can’t perform that action at this time.
0 commit comments