diff --git a/src/components/StationsView/utils.ts b/src/components/StationsView/utils.ts index b7ea8c2..b32ee90 100644 --- a/src/components/StationsView/utils.ts +++ b/src/components/StationsView/utils.ts @@ -132,13 +132,15 @@ function filterSliderValues(filters: Record, generalInfo: StationGe filters['minOneWayCatenary'] > routes.singleElectrifiedNames.length || filters['minOneWay'] > routes.singleOtherNames.length || filters['minTwoWayCatenary'] > routes.doubleElectrifiedNames.length || - // filters['minTwoWay'] > routes.doubleOtherNames.length || + filters['minTwoWay'] > routes.doubleOtherNames.length || filters['minOneWayCatenaryInt'] > internalRoutes.filter((r) => r.routeTracks == 1 && r.isElectric == true).length || filters['minOneWayInt'] > internalRoutes.filter((r) => r.routeTracks == 1 && r.isElectric == false).length || filters['minTwoWayCatenaryInt'] > - internalRoutes.filter((r) => r.routeTracks == 2 && r.isElectric == true).length + internalRoutes.filter((r) => r.routeTracks == 2 && r.isElectric == true).length || + filters['minTwoWayInt'] > + internalRoutes.filter((r) => r.routeTracks == 2 && r.isElectric == false).length ); } @@ -243,7 +245,7 @@ export const sortStations = (a: Station, b: Station, sorter: ActiveSorter) => { return a.name.localeCompare(b.name); }; -export const filterStations = (station: Station, filters: Record) => { +export const filterStations = (station: Station, filters: Record) => { if (filters['free'] && (!station.onlineInfo || station.onlineInfo.dispatcherId == -1)) return false; diff --git a/src/managers/stationFilterManager.ts b/src/managers/stationFilterManager.ts index c346010..2c33518 100644 --- a/src/managers/stationFilterManager.ts +++ b/src/managers/stationFilterManager.ts @@ -62,11 +62,12 @@ export const initFilters = { maxLevel: 20, minOneWay: 0, minOneWayCatenary: 0, - minTwoWayCatenary: 0, minOneWayInt: 0, minOneWayCatenaryInt: 0, + minTwoWay: 0, + minTwoWayCatenary: 0, + minTwoWayInt: 0, minTwoWayCatenaryInt: 0, - // minTwoWay: 0, authors: '' }; @@ -77,12 +78,12 @@ export const sliderStates = [ { id: 'maxLevel', minRange: 0, maxRange: 20, step: 1 }, { id: 'minOneWay', minRange: 0, maxRange: 5, step: 1 }, { id: 'minOneWayCatenary', minRange: 0, maxRange: 5, step: 1 }, - { id: 'minTwoWayCatenary', minRange: 0, maxRange: 5, step: 1 }, { id: 'minOneWayInt', minRange: 0, maxRange: 5, step: 1 }, { id: 'minOneWayCatenaryInt', minRange: 0, maxRange: 5, step: 1 }, + { id: 'minTwoWay', minRange: 0, maxRange: 5, step: 1 }, + { id: 'minTwoWayCatenary', minRange: 0, maxRange: 5, step: 1 }, + { id: 'minTwoWayInt', minRange: 0, maxRange: 5, step: 1 }, { id: 'minTwoWayCatenaryInt', minRange: 0, maxRange: 5, step: 1 }, - // { id: 'minTwoWay', minRange: 0, maxRange: 5, step: 1 }, - // { id: 'minTwoWayInt', minRange: 0, maxRange: 5, step: 1 } ]; export type StationFilter = keyof typeof initFilters;