mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
feat(app): added min route speed & max route speed station filters
This commit is contained in:
@@ -9,4 +9,7 @@ export interface StationRoutes {
|
||||
doubleElectrifiedNames: string[];
|
||||
doubleOtherNames: string[];
|
||||
sblNames: string[];
|
||||
|
||||
minRouteSpeed: number;
|
||||
maxRouteSpeed: number;
|
||||
}
|
||||
|
||||
@@ -189,9 +189,11 @@ export const filterStations = (station: Station, filters: Filter) => {
|
||||
availability == 'nonPublic' || availability == 'unavailable' || availability == 'abandoned';
|
||||
|
||||
if (reqLevel + (otherAvailability ? 1 : 0) < filters['minLevel']) return false;
|
||||
|
||||
if (reqLevel + (otherAvailability ? 1 : 0) > filters['maxLevel']) return false;
|
||||
|
||||
if (filters['minVmax'] > station.generalInfo.routes.maxRouteSpeed) return false;
|
||||
if (filters['maxVmax'] < station.generalInfo.routes.minRouteSpeed) return false;
|
||||
|
||||
if (
|
||||
filters['no-1track'] &&
|
||||
(routes.singleElectrifiedNames.length != 0 || routes.singleOtherNames.length != 0)
|
||||
|
||||
Reference in New Issue
Block a user