mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 22:08:12 +00:00
Fix: zmiana regionów w filtrach
This commit is contained in:
@@ -167,7 +167,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
handleChangeRegion() {
|
handleChangeRegion() {
|
||||||
this.$store.commit(MUTATIONS.SET_REGION, this.currentRegion);
|
this.$store.commit(MUTATIONS.SET_REGION, this.currentRegion);
|
||||||
this.$store.dispatch(ACTIONS.fetchOnlineData);
|
|
||||||
|
|
||||||
this.closeCard();
|
this.closeCard();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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 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 => {
|
export const getStatusID = (stationStatus: any): string => {
|
||||||
if (!stationStatus) return "not-signed";
|
if (!stationStatus) return "unknown";
|
||||||
if (stationStatus == -1) return "unknown";
|
if (stationStatus == -1) return "unavailable";
|
||||||
|
|
||||||
const statusCode = stationStatus[2];
|
const statusCode = stationStatus[2];
|
||||||
const statusTimestamp = stationStatus[3];
|
const statusTimestamp = stationStatus[3];
|
||||||
@@ -30,7 +30,7 @@ export const getStatusID = (stationStatus: any): string => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "unavailable";
|
return "not-signed";
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getStatusTimestamp = (stationStatus: any): number => {
|
export const getStatusTimestamp = (stationStatus: any): number => {
|
||||||
|
|||||||
+1
-1
@@ -169,7 +169,6 @@ export const store = createStore<State>({
|
|||||||
commit(MUTATIONS.SET_DISPATCHER_DATA_STATUS, !data.dispatchers ? DataStatus.Warning : DataStatus.Loaded)
|
commit(MUTATIONS.SET_DISPATCHER_DATA_STATUS, !data.dispatchers ? DataStatus.Warning : DataStatus.Loaded)
|
||||||
commit(MUTATIONS.SET_TRAINS_DATA_STATUS, !data.trains ? DataStatus.Warning : DataStatus.Loaded);
|
commit(MUTATIONS.SET_TRAINS_DATA_STATUS, !data.trains ? DataStatus.Warning : DataStatus.Loaded);
|
||||||
|
|
||||||
|
|
||||||
// Zaktualizuj listę pociągów
|
// Zaktualizuj listę pociągów
|
||||||
const updatedTrainList: Train[] =
|
const updatedTrainList: Train[] =
|
||||||
data.trains
|
data.trains
|
||||||
@@ -394,6 +393,7 @@ export const store = createStore<State>({
|
|||||||
|
|
||||||
SET_REGION(state, region: { id: string; value: string }) {
|
SET_REGION(state, region: { id: string; value: string }) {
|
||||||
state.region = region;
|
state.region = region;
|
||||||
|
state.webSocket?.emit('FETCH_DATA');
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user