mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Fix błędów z reaktywnością danych
This commit is contained in:
@@ -71,19 +71,16 @@ export default defineComponent({
|
||||
const filterManager = reactive(new StationFilterManager());
|
||||
const focusedStationName = '';
|
||||
|
||||
const computedStations: ComputedRef<Station[]> = computed(() => {
|
||||
return filterManager.getFilteredStationList(store.stationList);
|
||||
});
|
||||
|
||||
const focusedStationInfo = computed(() =>
|
||||
computedStations.value.find((station) => station.name === focusedStationName)
|
||||
const computedStations: ComputedRef<Station[]> = computed(() =>
|
||||
filterManager
|
||||
.getFilteredStationList(store.stationList)
|
||||
.filter((station) => !station.onlineInfo || station.onlineInfo.region == store.region.id)
|
||||
);
|
||||
|
||||
return {
|
||||
computedStations,
|
||||
filterManager,
|
||||
focusedStationName,
|
||||
focusedStationInfo,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
<section class="trains-view">
|
||||
<div class="wrapper">
|
||||
<div class="options-bar">
|
||||
<!-- <TrainStats :trains="trainList" :trainStatsOpen="trainStatsOpen" /> -->
|
||||
|
||||
<train-options />
|
||||
</div>
|
||||
|
||||
@@ -51,8 +49,6 @@ export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore();
|
||||
|
||||
const trainList = store.trainList;
|
||||
|
||||
const sorterActive = ref({ id: 'distance', dir: -1 });
|
||||
const filterList = reactive([...trainFilters]) as TrainFilter[];
|
||||
const isTrainOptionsCardVisible = ref(false);
|
||||
@@ -67,11 +63,16 @@ export default defineComponent({
|
||||
provide('isTrainOptionsCardVisible', isTrainOptionsCardVisible);
|
||||
|
||||
const computedTrains: ComputedRef<Train[]> = computed(() => {
|
||||
return filteredTrainList(trainList, searchedTrain.value, searchedDriver.value, sorterActive.value, filterList);
|
||||
return filteredTrainList(
|
||||
store.trainList,
|
||||
searchedTrain.value,
|
||||
searchedDriver.value,
|
||||
sorterActive.value,
|
||||
filterList
|
||||
);
|
||||
});
|
||||
|
||||
return {
|
||||
trainList,
|
||||
computedTrains,
|
||||
searchedTrain,
|
||||
searchedDriver,
|
||||
|
||||
Reference in New Issue
Block a user