chore(options): restored preserving settings in local storage

This commit is contained in:
2026-04-13 20:10:13 +02:00
parent 5ea91a0c48
commit 60aba8d549
+7 -22
View File
@@ -188,19 +188,9 @@ export default defineComponent({
currentRowAnimating: 0 currentRowAnimating: 0
}), }),
async created() {
// this.selectDefaultCheckpoint();
window.addEventListener('resize', () => {
this.resizeTable();
});
},
activated() { activated() {
this.mainStore.selectedStationName = this.stationName; this.mainStore.selectedStationName = this.stationName;
this.resizeTable();
this.selectDefaultCheckpoint(); this.selectDefaultCheckpoint();
this.shuffleRoutes(); this.shuffleRoutes();
@@ -268,6 +258,13 @@ export default defineComponent({
} }
}, },
'mainStore.filters': {
deep: true,
handler: function (val) {
window.localStorage.setItem('settings', JSON.stringify(val));
}
},
'apiStore.activeData'(_val, prevVal) { 'apiStore.activeData'(_val, prevVal) {
if (prevVal == undefined) { if (prevVal == undefined) {
this.selectDefaultCheckpoint(); this.selectDefaultCheckpoint();
@@ -360,18 +357,6 @@ export default defineComponent({
}, },
methods: { methods: {
resizeTable() {
// const elRef = this.$refs['pragotron'] as HTMLElement;
// if (!elRef) return;
// const scale = Math.min(
// window.innerWidth / elRef.clientWidth,
// window.innerHeight / elRef.clientHeight,
// 1
// );
// console.log(elRef.clientWidth);
// elRef.style.transform = `scale(${scale})`;
},
selectDefaultCheckpoint() { selectDefaultCheckpoint() {
this.mainStore.selectedCheckpointName = this.mainStore.selectedCheckpointName =
this.mainStore.selectedStation?.stationCheckpoints[0] || this.stationName; this.mainStore.selectedStation?.stationCheckpoints[0] || this.stationName;