mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 22:08:12 +00:00
Merge pull request #121 from Spythere/development
hotfix: lastSeen data filtering synchronization
This commit is contained in:
@@ -23,7 +23,10 @@
|
|||||||
<span class="user_name">
|
<span class="user_name">
|
||||||
{{ train.driverName }}
|
{{ train.driverName }}
|
||||||
<i
|
<i
|
||||||
v-if="train.timetableData != undefined && train.lastSeen <= Date.now() - 120000"
|
v-if="
|
||||||
|
train.timetableData != undefined &&
|
||||||
|
(train.lastSeen <= Date.now() - 60000 || !train.online)
|
||||||
|
"
|
||||||
class="fa-solid fa-user-slash"
|
class="fa-solid fa-user-slash"
|
||||||
style="color: lightcoral"
|
style="color: lightcoral"
|
||||||
data-tooltip-type="BaseTooltip"
|
data-tooltip-type="BaseTooltip"
|
||||||
|
|||||||
@@ -42,8 +42,13 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
checkpointsTrains.clear();
|
checkpointsTrains.clear();
|
||||||
sceneriesTrains.clear();
|
sceneriesTrains.clear();
|
||||||
|
|
||||||
return (apiStore.activeData?.trains ?? [])
|
const dateNow = new Date();
|
||||||
.filter((train) => train.timetable || train.lastSeen >= Date.now() - 60000)
|
|
||||||
|
const x = (apiStore.activeData?.trains ?? [])
|
||||||
|
.filter(
|
||||||
|
(train) =>
|
||||||
|
train.timetable || train.lastSeen >= dateNow.getTime() - 60000 || train.online == 1
|
||||||
|
)
|
||||||
.map((train) => {
|
.map((train) => {
|
||||||
const stock = train.stockString.split(';');
|
const stock = train.stockString.split(';');
|
||||||
const locoType = stock ? stock[0] : train.stockString;
|
const locoType = stock ? stock[0] : train.stockString;
|
||||||
@@ -163,6 +168,8 @@ export const useMainStore = defineStore('mainStore', {
|
|||||||
|
|
||||||
return trainObj;
|
return trainObj;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return x;
|
||||||
},
|
},
|
||||||
|
|
||||||
// computed active sceneries
|
// computed active sceneries
|
||||||
|
|||||||
Reference in New Issue
Block a user