sortowanie po liczbie szlaków i ocenie dyżurnego

This commit is contained in:
2024-03-03 21:44:39 +01:00
parent 9f5d882119
commit 40bbdbe4fa
4 changed files with 37 additions and 18 deletions
+1
View File
@@ -11,6 +11,7 @@ export const headIds = [
export const headIconsIds = [
'user',
'like',
'spawn',
'timetableAll',
'timetableUnconfirmed',
+16
View File
@@ -54,12 +54,28 @@ export const sortStations = (
diff = (a.onlineInfo?.dispatcherExp || 0) - (b.onlineInfo?.dispatcherExp || 0);
break;
case 'routes-single':
diff =
(a.generalInfo?.routes.single.length ?? -1) - (b.generalInfo?.routes.single.length ?? -1);
break;
case 'routes-double':
diff =
(a.generalInfo?.routes.double.length ?? -1) - (b.generalInfo?.routes.double.length ?? -1);
break;
case 'user':
diff =
(b.onlineInfo ? b.onlineInfo.currentUsers : -1) -
(a.onlineInfo ? a.onlineInfo.currentUsers : -1);
break;
case 'like':
diff =
(b.onlineInfo ? b.onlineInfo.dispatcherRate : -Infinity) -
(a.onlineInfo ? a.onlineInfo.dispatcherRate : -Infinity);
break;
case 'spawn':
diff =
(a.onlineInfo ? a.onlineInfo.spawns.length : -1) -