chore(filters): added station filtering by route types and maximum count

This commit is contained in:
2026-03-12 21:59:53 +01:00
parent 1a39c9054b
commit ffe26a8fd2
8 changed files with 62 additions and 40 deletions
+14 -5
View File
@@ -29,7 +29,7 @@ export const useMainStore = defineStore('mainStore', {
chosenModalTrainId: undefined,
modalLastClickedTarget: null,
currentLocale: 'pl',
currentLocale: 'pl'
}) as MainStoreState,
actions: {
@@ -391,11 +391,13 @@ export const useMainStore = defineStore('mainStore', {
const tracksKey = route.routeTracks == 2 ? 'double' : 'single';
const isElectric = route.isElectric;
const routesKey: keyof StationRoutes = `${tracksKey}${
!isElectric ? 'Other' : 'Electrified'
}Names`;
}${route.isInternal ? 'Internal' : ''}Names`;
acc[routesKey].push(route.routeName);
if (!route.isInternal) acc[routesKey].push(route.routeName);
if (route.isRouteSBL) acc['sblNames'].push(route.routeName);
acc.minRouteSpeed =
@@ -410,14 +412,21 @@ export const useMainStore = defineStore('mainStore', {
return acc;
},
{
all: [],
single: [],
double: [],
singleElectrifiedNames: [],
singleOtherNames: [],
double: [],
doubleElectrifiedNames: [],
doubleOtherNames: [],
singleElectrifiedInternalNames: [],
singleOtherInternalNames: [],
doubleElectrifiedInternalNames: [],
doubleOtherInternalNames: [],
sblNames: [],
all: [],
minRouteSpeed: 0,
maxRouteSpeed: 0
} as StationRoutes