mirror of
https://github.com/Spythere/pragotron-td2.git
synced 2026-05-03 05:28:14 +00:00
chore(options): restored preserving settings in local storage
This commit is contained in:
@@ -188,19 +188,9 @@ export default defineComponent({
|
||||
currentRowAnimating: 0
|
||||
}),
|
||||
|
||||
async created() {
|
||||
// this.selectDefaultCheckpoint();
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
this.resizeTable();
|
||||
});
|
||||
},
|
||||
|
||||
activated() {
|
||||
this.mainStore.selectedStationName = this.stationName;
|
||||
|
||||
this.resizeTable();
|
||||
|
||||
this.selectDefaultCheckpoint();
|
||||
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) {
|
||||
if (prevVal == undefined) {
|
||||
this.selectDefaultCheckpoint();
|
||||
@@ -360,18 +357,6 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
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() {
|
||||
this.mainStore.selectedCheckpointName =
|
||||
this.mainStore.selectedStation?.stationCheckpoints[0] || this.stationName;
|
||||
|
||||
Reference in New Issue
Block a user