diff --git a/src/scripts/managers/stationFilterManager.ts b/src/scripts/managers/stationFilterManager.ts index 4629398..8467cee 100644 --- a/src/scripts/managers/stationFilterManager.ts +++ b/src/scripts/managers/stationFilterManager.ts @@ -5,10 +5,10 @@ import StorageManager from './storageManager'; const sortStations = (a: Station, b: Station, sorter: { index: number; dir: number }) => { switch (sorter.index) { case 1: - if ((a.generalInfo?.reqLevel || -1 ) > (b.generalInfo?.reqLevel || -1)) return sorter.dir; - if ((a.generalInfo?.reqLevel || -1) < (b.generalInfo?.reqLevel || -1)) return -sorter.dir; - + if ((a.generalInfo?.reqLevel || 0) > (b.generalInfo?.reqLevel || 0)) return sorter.dir; + if ((a.generalInfo?.reqLevel || 0) < (b.generalInfo?.reqLevel || 0)) return -sorter.dir; break; + case 2: if ((a.onlineInfo?.statusTimestamp || 0) > (b.onlineInfo?.statusTimestamp || 0)) return sorter.dir; if ((a.onlineInfo?.statusTimestamp || 0) < (b.onlineInfo?.statusTimestamp || 0)) return -sorter.dir; @@ -195,15 +195,6 @@ export default class StationFilterManager { this.filters[prop] = !this.filters[prop]; }) - - // for(let prop in this.filters) { - // if(typeof prop !== "boolean") continue; - - // this.filters[prop] = !this.filterInitStates[prop]; - - // console.log("inverted!"); - - // } } changeSorter(index: number) { diff --git a/src/store/index.ts b/src/store/index.ts index f6f3417..7392cf7 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -282,7 +282,7 @@ export const store = createStore({ url: station[1], lines: station[2], project: station[3], - reqLevel: station[4] == "" ? -1 : Number(station[4]), + reqLevel: station[4] == "" || station[4] === null ? -1 : Number(station[4]), supportersOnly: station[5] == "TAK", signalType: station[6], controlType: station[7],