mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
chore: checkpoints detection fix
This commit is contained in:
@@ -213,9 +213,7 @@ export default defineComponent({
|
|||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
|
|
||||||
const chosenCheckpoint = ref(
|
const chosenCheckpoint = ref(
|
||||||
props.station?.generalInfo?.checkpoints?.length == 0
|
props.station?.generalInfo?.checkpoints[0] ?? props.station?.name ?? ''
|
||||||
? ''
|
|
||||||
: props.station?.generalInfo?.checkpoints[0] ?? null
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -238,6 +236,8 @@ export default defineComponent({
|
|||||||
if (!this.station) return [];
|
if (!this.station) return [];
|
||||||
if (!this.onlineScenery) return [];
|
if (!this.onlineScenery) return [];
|
||||||
|
|
||||||
|
console.log(this.onlineScenery.scheduledTrains, this.chosenCheckpoint);
|
||||||
|
|
||||||
return this.onlineScenery.scheduledTrains
|
return this.onlineScenery.scheduledTrains
|
||||||
.filter(
|
.filter(
|
||||||
(ct) =>
|
(ct) =>
|
||||||
|
|||||||
@@ -239,8 +239,8 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
const station = this.stationList.find((s) => s.name === scenery.name);
|
const station = this.stationList.find((s) => s.name === scenery.name);
|
||||||
|
|
||||||
const checkpoints = [scenery.name];
|
const checkpoints = [scenery.name];
|
||||||
if (station?.generalInfo?.checkpoints)
|
if (station?.generalInfo?.checkpoints && station.generalInfo.checkpoints.length > 0)
|
||||||
checkpoints.push(...station.generalInfo.checkpoints.filter((cp) => cp != scenery.name));
|
checkpoints.push(...station.generalInfo.checkpoints.filter((cp) => cp !== station.name));
|
||||||
|
|
||||||
scenery.stationTrains =
|
scenery.stationTrains =
|
||||||
sceneriesTrains.get(scenery.name)?.filter((sc) => sc.region == this.region.id) ?? [];
|
sceneriesTrains.get(scenery.name)?.filter((sc) => sc.region == this.region.id) ?? [];
|
||||||
@@ -320,7 +320,10 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
...scenery,
|
...scenery,
|
||||||
authors: scenery.authors?.split(',').map((a) => a.trim()),
|
authors: scenery.authors?.split(',').map((a) => a.trim()),
|
||||||
routes: routes,
|
routes: routes,
|
||||||
checkpoints: scenery.checkpoints?.split(';') ?? []
|
checkpoints:
|
||||||
|
scenery.checkpoints && scenery.checkpoints.trim().length > 0
|
||||||
|
? scenery.checkpoints.split(';')
|
||||||
|
: []
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user