From f3663fa222252cbc076999f221cecb9347c661c0 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 20 Nov 2020 20:27:12 +0100 Subject: [PATCH] Aktualizacja listy scenerii, poprawki w widoku RJ i filtrowaniu --- src/data/stations.json | 1 + src/store/store.ts | 19 ++++++++++--------- src/views/TimetableView.vue | 6 +++++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/data/stations.json b/src/data/stations.json index 72f9131..72cc72a 100644 --- a/src/data/stations.json +++ b/src/data/stations.json @@ -1870,6 +1870,7 @@ "default": false, "nonPublic": false, "unavailable": true, + "subStations": ["Sroka, podg.", "Sroka PoĊ‚udnie, podg."], "stops": ["Sroka, podg."] }, { diff --git a/src/store/store.ts b/src/store/store.ts index 774069a..1cecbe3 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -399,10 +399,9 @@ export default class Store extends VuexModule { const stopName = stop.stopNameRAW.toLowerCase(); if (stationName === stopName) return true; - if (stopName.includes(stationName)) return true; - if (stationName.includes(stopName)) return true; - - if (stopName.includes('podg.') && stopName.split(', podg.')[0] && stationName.includes(stopName.split(', podg.')[0])) return true; + if (stopName.includes(stationName) && !stop.stopName.includes('po.') && !stop.stopName.includes('podg.')) return true; + if (stationName.includes(stopName) && !stop.stopName.includes('po.') && !stop.stopName.includes('podg.')) return true; + if (stopName.includes('podg.') && stopName.split(', podg.')[0] && stationName === stopName.split(', podg.')[0]) return true; if (JSONStationData.some(data => data.stationName.includes(station.stationName) && data.stops && data.stops.includes(stop.stopNameRAW))) return true; @@ -444,12 +443,14 @@ export default class Store extends VuexModule { stopStatusID = 3; } - for (let i = stopInfoIndex; i < timetableData.followingStops.length - 1; i++) { - const stop = timetableData.followingStops[i]; + if (stopInfoIndex < timetableData.followingStops.length - 2) { + for (let i = stopInfoIndex + 1; i < timetableData.followingStops.length - 1; i++) { + const stop = timetableData.followingStops[i]; - if (stop.mainStop && stop.stopType.includes('ph')) { - nearestStop = stop.stopNameRAW; - break; + if (stop.mainStop && stop.stopType.includes('ph')) { + nearestStop = stop.stopNameRAW; + break; + } } } diff --git a/src/views/TimetableView.vue b/src/views/TimetableView.vue index d76b19e..68e4ba0 100644 --- a/src/views/TimetableView.vue +++ b/src/views/TimetableView.vue @@ -425,7 +425,7 @@ export default class TimetableView extends Vue { currentRow.category = train.category; currentRow.number = train.trainNo; - currentRow.departureMinutesString = departureMinutes.toString(); + currentRow.departureHoursString = departureHours.toString(); currentRow.departureMinutesString = departureMinutes.toString(); currentRow.trainNumberString = trainNumberString; @@ -546,6 +546,10 @@ export default class TimetableView extends Vue { nextRefreshTime = time + 100; } + // console.log( + // letterSeekArray.length < 10 ? letterSeekArray : letterSeekArray.length + // ); + if (letterSeekArray.length > 0 && !soundPlaying) { sound.play(); soundPlaying = true;