Poprawki w działaniu, zmiany estetyczne

This commit is contained in:
2020-09-12 22:05:49 +02:00
parent aaccf162d9
commit 1c329d9ea9
5 changed files with 106 additions and 70 deletions
+8 -7
View File
@@ -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[]);