Dodano support przy kliknięciu scenerii offline.

This commit is contained in:
2020-12-02 21:28:52 +01:00
parent a072e6d42e
commit 555384aaec
2 changed files with 10 additions and 5 deletions
+9 -5
View File
@@ -202,12 +202,16 @@ export default class StationTable extends styleMixin {
@Prop() readonly changeSorter!: () => void; @Prop() readonly changeSorter!: () => void;
setScenery(sceneryHash: string) { setScenery(sceneryHash: string) {
if ( const station = this.stations.find(
this.stations.findIndex( (station) => station.stationHash === sceneryHash
(station) => station.stationHash === sceneryHash && station.online );
) == -1
) if (!station) return;
if (!station.online) {
location.href = station.stationURL;
return; return;
}
this.$router.push({ name: "SceneryView", query: { hash: sceneryHash } }); this.$router.push({ name: "SceneryView", query: { hash: sceneryHash } });
} }
+1
View File
@@ -4,6 +4,7 @@ import ScheduledTrain from './ScheduledTrain';
export default interface Station { export default interface Station {
stationName: string; stationName: string;
stationHash: string; stationHash: string;
stationURL: string;
maxUsers: number; maxUsers: number;
currentUsers: number; currentUsers: number;