mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Dodano support przy kliknięciu scenerii offline.
This commit is contained in:
@@ -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 } });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user