zapamiętywanie uzupełniania skrótu

This commit is contained in:
2023-09-04 19:01:09 +02:00
parent bb285f9ba6
commit 05f3f8f8b2
+7 -2
View File
@@ -101,6 +101,8 @@ export default defineComponent({
}, },
created() { created() {
this.fillCheckpointName = window.localStorage.getItem('fill-checkpoint') == 'true';
this.fetchSceneriesData(); this.fetchSceneriesData();
}, },
@@ -124,6 +126,10 @@ export default defineComponent({
selectedSceneryName() { selectedSceneryName() {
this.selectedCheckpointName = this.checkpointNameList.length == 0 ? null : this.checkpointNameList[0]; this.selectedCheckpointName = this.checkpointNameList.length == 0 ? null : this.checkpointNameList[0];
}, },
fillCheckpointName(val: boolean) {
window.localStorage.setItem('fill-checkpoint', `${val}`);
},
}, },
computed: { computed: {
@@ -224,8 +230,7 @@ export default defineComponent({
this.store.orderFooter.minutes = currentFormattedMinutes(); this.store.orderFooter.minutes = currentFormattedMinutes();
if (this.fillCheckpointName) { if (this.fillCheckpointName) {
const sceneryAbbrev = this.sceneriesData.find(({ name }) => name === this.store.orderFooter.stationName)?.abbr; const sceneryAbbrev = this.sceneriesData.find(({ name }) => name === this.selectedSceneryName)?.abbr;
this.store.orderFooter.checkpointName = sceneryAbbrev || this.store.orderFooter.stationName.slice(0, 2); this.store.orderFooter.checkpointName = sceneryAbbrev || this.store.orderFooter.stationName.slice(0, 2);
} }