From b3f710897923383bb466a572b2ea449c6e56f08b Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 12 Jul 2024 13:58:43 +0200 Subject: [PATCH 1/5] fix: detecting podg in timetables --- src/store/mainStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/mainStore.ts b/src/store/mainStore.ts index 1f53c51..db7cc11 100644 --- a/src/store/mainStore.ts +++ b/src/store/mainStore.ts @@ -125,7 +125,7 @@ export const useMainStore = defineStore('mainStore', { const timetablePath = trainObj.timetableData.timetablePath; trainObj.timetableData.followingStops.forEach((stop, i) => { - if (/strong|podg\.|pe\./.test(stop.stopName)) { + if (/strong|podg|pe/.test(stop.stopName)) { const checkpointTrain: CheckpointTrain = { train: trainObj, checkpointStop: stop, From 3d1c66b420e240ed97be149fc8941769bbf3e876 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 12 Jul 2024 14:50:01 +0200 Subject: [PATCH 2/5] fix: cache control --- src/store/apiStore.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/store/apiStore.ts b/src/store/apiStore.ts index bb828dd..4e66840 100644 --- a/src/store/apiStore.ts +++ b/src/store/apiStore.ts @@ -51,6 +51,12 @@ export const useApiStore = defineStore('apiStore', { // Static data this.fetchDonatorsData(); this.fetchStationsGeneralInfo(); + + // Ponowne pobieranie danych po ServiceWorkerze + setTimeout(() => { + this.fetchStationsGeneralInfo(); + }, Math.floor(Math.random() * 500) + 1000); + this.fetchVehiclesInfo(); }, From d73c8ef11230c35c2475c71a5164c49e51140232 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 12 Jul 2024 15:11:17 +0200 Subject: [PATCH 3/5] fix: update modal won't open on first visit --- src/App.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index e9e4ff1..9560b62 100644 --- a/src/App.vue +++ b/src/App.vue @@ -131,7 +131,8 @@ export default defineComponent({ }; this.isUpdateCardOpen = - storageVersion != version || import.meta.env.VITE_UPDATE_TEST === 'test'; + (storageVersion != '' && storageVersion != version) || + import.meta.env.VITE_UPDATE_TEST === 'test'; } catch (error) { console.error(`Wystąpił błąd podczas pobierania danych z API GitHuba: ${error}`); } From 63b268d9b9313302cd59923cc71087c372f293c2 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 12 Jul 2024 15:59:08 +0200 Subject: [PATCH 4/5] feat: added journal timetable path --- .../JournalTimetables/TimetableStops.vue | 90 +++++++++++++++---- ...toryList.vue => _TimetableHistoryList.vue} | 0 src/typings/api.ts | 8 +- 3 files changed, 74 insertions(+), 24 deletions(-) rename src/components/JournalView/JournalTimetables/{TimetableHistoryList.vue => _TimetableHistoryList.vue} (100%) diff --git a/src/components/JournalView/JournalTimetables/TimetableStops.vue b/src/components/JournalView/JournalTimetables/TimetableStops.vue index ad5e89b..2babb61 100644 --- a/src/components/JournalView/JournalTimetables/TimetableStops.vue +++ b/src/components/JournalView/JournalTimetables/TimetableStops.vue @@ -1,23 +1,41 @@ @@ -42,6 +60,24 @@ export default defineComponent({ }, computed: { + timetablePathDetails() { + if (!this.timetable.path || this.timetable.path == '') return null; + + return this.timetable.path.split(';').map((pathEl, i) => { + const [arrival, name, departure] = pathEl.split(','); + const sceneryName = name.split(' ').slice(0, -1).join(' '); + const sceneryHash = name.split(' ').pop()?.replace('.sc', '') ?? ''; + + return { + arrival, + sceneryName, + sceneryHash, + departure, + isVisited: this.timetable.visitedSceneries?.includes(sceneryHash) ?? false + }; + }); + }, + timetableStops() { const timetable = this.timetable; @@ -94,13 +130,14 @@ export default defineComponent({ diff --git a/src/components/JournalView/JournalTimetables/TimetableHistoryList.vue b/src/components/JournalView/JournalTimetables/_TimetableHistoryList.vue similarity index 100% rename from src/components/JournalView/JournalTimetables/TimetableHistoryList.vue rename to src/components/JournalView/JournalTimetables/_TimetableHistoryList.vue diff --git a/src/typings/api.ts b/src/typings/api.ts index 42da469..954ff7a 100644 --- a/src/typings/api.ts +++ b/src/typings/api.ts @@ -195,7 +195,7 @@ export namespace API { TWR: boolean; SKR: boolean; sceneries: string[]; - + path: string; } } @@ -251,16 +251,14 @@ export namespace API { hashesString?: string; currentSceneryName?: string; currentSceneryHash?: string; - routeSceneries?: string; - checkpointArrivals?: string[]; checkpointDepartures?: string[]; - checkpointArrivalsScheduled?: string[]; checkpointDeparturesScheduled?: string[]; - checkpointStopTypes?: string[]; + visitedSceneries?: string[]; + path: string; } export type Response = Data[]; From bdf85cd8ecb60f34f11e7bfc37ee6c468b8deb90 Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 12 Jul 2024 16:00:32 +0200 Subject: [PATCH 5/5] bump: 1.25.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d61e816..46145e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stacjownik", - "version": "1.25.1", + "version": "1.25.2", "private": true, "scripts": { "dev": "vite",