Fix: zmiana regionów w filtrach

This commit is contained in:
2022-04-14 14:22:15 +02:00
parent ebede5349c
commit da28ceb705
3 changed files with 4 additions and 5 deletions
@@ -167,7 +167,6 @@ export default defineComponent({
handleChangeRegion() {
this.$store.commit(MUTATIONS.SET_REGION, this.currentRegion);
this.$store.dispatch(ACTIONS.fetchOnlineData);
this.closeCard();
},
+3 -3
View File
@@ -4,8 +4,8 @@ import TrainStop from "../interfaces/TrainStop";
export const getLocoURL = (locoType: string): string => (`https://rj.td2.info.pl/dist/img/thumbnails/${locoType.includes("EN") ? locoType + "rb" : locoType}.png`)
export const getStatusID = (stationStatus: any): string => {
if (!stationStatus) return "not-signed";
if (stationStatus == -1) return "unknown";
if (!stationStatus) return "unknown";
if (stationStatus == -1) return "unavailable";
const statusCode = stationStatus[2];
const statusTimestamp = stationStatus[3];
@@ -30,7 +30,7 @@ export const getStatusID = (stationStatus: any): string => {
break;
}
return "unavailable";
return "not-signed";
};
export const getStatusTimestamp = (stationStatus: any): number => {
+1 -1
View File
@@ -169,7 +169,6 @@ export const store = createStore<State>({
commit(MUTATIONS.SET_DISPATCHER_DATA_STATUS, !data.dispatchers ? DataStatus.Warning : DataStatus.Loaded)
commit(MUTATIONS.SET_TRAINS_DATA_STATUS, !data.trains ? DataStatus.Warning : DataStatus.Loaded);
// Zaktualizuj listę pociągów
const updatedTrainList: Train[] =
data.trains
@@ -394,6 +393,7 @@ export const store = createStore<State>({
SET_REGION(state, region: { id: string; value: string }) {
state.region = region;
state.webSocket?.emit('FETCH_DATA');
},
}