mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Poprawki w działaniu, zmiany estetyczne
This commit is contained in:
+8
-7
@@ -295,8 +295,15 @@ export default class Store extends VuexModule {
|
||||
private updateOnlineStations(updatedStationList: any[]) {
|
||||
this.stationList = this.stationList.reduce((acc, station) => {
|
||||
const onlineStationData = updatedStationList.find(updatedStation => updatedStation.stationName === station.stationName);
|
||||
const isRegistered = JSONStationData.some(data => data.stationName === station.stationName);
|
||||
|
||||
if (!onlineStationData) {
|
||||
if (onlineStationData)
|
||||
acc.push({
|
||||
...station,
|
||||
...onlineStationData,
|
||||
online: true,
|
||||
});
|
||||
else if (isRegistered)
|
||||
acc.push({
|
||||
...station,
|
||||
stationProject: '',
|
||||
@@ -312,12 +319,6 @@ export default class Store extends VuexModule {
|
||||
statusTimestamp: -3,
|
||||
online: false,
|
||||
});
|
||||
} else
|
||||
acc.push({
|
||||
...station,
|
||||
...onlineStationData,
|
||||
online: true,
|
||||
});
|
||||
|
||||
return acc;
|
||||
}, [] as Station[]);
|
||||
|
||||
Reference in New Issue
Block a user