1.3.5->.6: aktualizacja scenerii, poprawki w filtrowaniu

This commit is contained in:
2021-02-06 21:40:27 +01:00
parent ec74a43483
commit aac1d6c132
4 changed files with 29 additions and 20 deletions
+24 -17
View File
@@ -412,13 +412,11 @@ export default class Store extends VuexModule {
return acc;
}, [] as Station[]);
// Dodawanie do listy online potencjalnych scenerii niewpisanych do bazy
updatedStationList.forEach(updatedStation => {
const alreadyInList: any = this.stationList.some(station => station.stationName === updatedStation.stationName);
if (!alreadyInList) {
updatedStationList
.filter(uStation => !this.stationList.some(station => uStation.stationName === station.stationName))
.forEach(uStation => {
this.stationList.push({
...updatedStation,
...uStation,
scheduledTrains: [],
stationTrains: [],
subStations: [],
@@ -426,8 +424,26 @@ export default class Store extends VuexModule {
reqLevel: '-1',
nonPublic: true,
});
}
});
});
// Dodawanie do listy online potencjalnych scenerii niewpisanych do bazy
// updatedStationList.forEach(updatedStation => {
// const alreadyInList: any = this.stationList.some(station => station.stationName === updatedStation.stationName);
// console.log(updatedStation, alreadyInList);
// if (!alreadyInList) {
// this.stationList.push({
// ...updatedStation,
// scheduledTrains: [],
// stationTrains: [],
// subStations: [],
// online: true,
// reqLevel: '-1',
// nonPublic: true,
// });
// }
// });
this.stationCount = this.stationList.filter(station => station.online).length;
this.dataConnectionStatus = Status.Loaded;
@@ -574,15 +590,6 @@ export default class Store extends VuexModule {
stopStatusID = 3;
}
// for (let i = stopInfoIndex; i < data.followingStops.length - 1; i++){
// const stop = data.followingStops[i];
// if (stop.mainStop && stop.stopType.includes("ph")) {
// nearestStop = stop.stopNameRAW;
// break;
// }
// }
checkpoint.scheduledTrains.push({
trainNo: data.trainNo,
driverName: data.driverName,