mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Poprawki w sortowaniu scenerii
This commit is contained in:
@@ -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) {
|
||||
|
||||
+1
-1
@@ -282,7 +282,7 @@ export const store = createStore<State>({
|
||||
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],
|
||||
|
||||
Reference in New Issue
Block a user