mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a4304d65f | |||
| edad5306f2 | |||
| 5b775dfec9 | |||
| a485652ca5 | |||
| ed308246d7 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "stacjownik",
|
"name": "stacjownik",
|
||||||
"version": "1.18.1",
|
"version": "1.18.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -53,28 +53,20 @@ export const sortStations = (
|
|||||||
|
|
||||||
case 'timetableConfirmed':
|
case 'timetableConfirmed':
|
||||||
diff =
|
diff =
|
||||||
(a.onlineInfo?.scheduledTrains
|
(a.onlineInfo?.scheduledTrainCount.confirmed ?? -1) -
|
||||||
? a.onlineInfo.scheduledTrains.filter((train) => train.stopInfo.confirmed).length
|
(b.onlineInfo?.scheduledTrainCount.confirmed ?? -1);
|
||||||
: -1) -
|
|
||||||
(b.onlineInfo?.scheduledTrains
|
|
||||||
? b.onlineInfo.scheduledTrains.filter((train) => train.stopInfo.confirmed).length
|
|
||||||
: -1);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'timetableUnconfirmed':
|
case 'timetableUnconfirmed':
|
||||||
diff =
|
diff =
|
||||||
(a.onlineInfo?.scheduledTrains
|
(a.onlineInfo?.scheduledTrainCount.unconfirmed ?? -1) -
|
||||||
? a.onlineInfo.scheduledTrains.filter((train) => !train.stopInfo.confirmed).length
|
(b.onlineInfo?.scheduledTrainCount.unconfirmed ?? -1);
|
||||||
: -1) -
|
|
||||||
(b.onlineInfo?.scheduledTrains
|
|
||||||
? b.onlineInfo.scheduledTrains.filter((train) => !train.stopInfo.confirmed).length
|
|
||||||
: -1);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'timetableAll':
|
case 'timetableAll':
|
||||||
diff =
|
diff =
|
||||||
(a.onlineInfo?.scheduledTrains ? a.onlineInfo.scheduledTrains.length : -1) -
|
(a.onlineInfo?.scheduledTrainCount.all ?? -1) -
|
||||||
(b.onlineInfo?.scheduledTrains ? b.onlineInfo.scheduledTrains.length : -1);
|
(b.onlineInfo?.scheduledTrainCount.all ?? -1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -135,6 +135,9 @@ export const useStore = defineStore('store', {
|
|||||||
.reduce((list, apiStation) => {
|
.reduce((list, apiStation) => {
|
||||||
if (apiStation.region != state.region.id) return list;
|
if (apiStation.region != state.region.id) return list;
|
||||||
|
|
||||||
|
if (apiStation.isOnline !== 1 && Date.now() - apiStation.lastSeen > 1000 * 60 * 3)
|
||||||
|
return list;
|
||||||
|
|
||||||
const dispatcherStatus = getDispatcherStatus(state as StoreState, apiStation);
|
const dispatcherStatus = getDispatcherStatus(state as StoreState, apiStation);
|
||||||
|
|
||||||
if (dispatcherStatus.statusID == DispatcherStatusID.Unknown) return list;
|
if (dispatcherStatus.statusID == DispatcherStatusID.Unknown) return list;
|
||||||
|
|||||||
Reference in New Issue
Block a user