diff --git a/src/components/StationsView/StationTable.vue b/src/components/StationsView/StationTable.vue index 98aa924..fdbe5b1 100644 --- a/src/components/StationsView/StationTable.vue +++ b/src/components/StationsView/StationTable.vue @@ -202,12 +202,16 @@ export default class StationTable extends styleMixin { @Prop() readonly changeSorter!: () => void; setScenery(sceneryHash: string) { - if ( - this.stations.findIndex( - (station) => station.stationHash === sceneryHash && station.online - ) == -1 - ) + const station = this.stations.find( + (station) => station.stationHash === sceneryHash + ); + + if (!station) return; + + if (!station.online) { + location.href = station.stationURL; return; + } this.$router.push({ name: "SceneryView", query: { hash: sceneryHash } }); } diff --git a/src/scripts/interfaces/Station.ts b/src/scripts/interfaces/Station.ts index 98ff8be..84fc079 100644 --- a/src/scripts/interfaces/Station.ts +++ b/src/scripts/interfaces/Station.ts @@ -4,6 +4,7 @@ import ScheduledTrain from './ScheduledTrain'; export default interface Station { stationName: string; stationHash: string; + stationURL: string; maxUsers: number; currentUsers: number;