mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
chore(scenery): added saving showing thumbnails state to local storage
This commit is contained in:
@@ -30,6 +30,7 @@ import { useMainStore } from '../../store/mainStore';
|
|||||||
import { useApiStore } from '../../store/apiStore';
|
import { useApiStore } from '../../store/apiStore';
|
||||||
import { ActiveScenery, Station } from '../../typings/common';
|
import { ActiveScenery, Station } from '../../typings/common';
|
||||||
import SceneryTimetableList from './SceneryTimetable/SceneryTimetableList.vue';
|
import SceneryTimetableList from './SceneryTimetable/SceneryTimetableList.vue';
|
||||||
|
import StorageManager from '../../managers/storageManager';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'SceneryTimetable',
|
name: 'SceneryTimetable',
|
||||||
@@ -54,6 +55,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
activated() {
|
activated() {
|
||||||
this.loadSelectedOption();
|
this.loadSelectedOption();
|
||||||
|
this.handleStockThumbnails();
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
@@ -88,6 +90,8 @@ export default defineComponent({
|
|||||||
methods: {
|
methods: {
|
||||||
toggleThumbnails() {
|
toggleThumbnails() {
|
||||||
this.showStockThumbnails = !this.showStockThumbnails;
|
this.showStockThumbnails = !this.showStockThumbnails;
|
||||||
|
|
||||||
|
StorageManager.setBooleanValue('showStockThumbnails', this.showStockThumbnails);
|
||||||
},
|
},
|
||||||
|
|
||||||
loadSelectedOption() {
|
loadSelectedOption() {
|
||||||
@@ -115,6 +119,12 @@ export default defineComponent({
|
|||||||
checkpointsListRef[0] ??
|
checkpointsListRef[0] ??
|
||||||
sceneryName;
|
sceneryName;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleStockThumbnails() {
|
||||||
|
const storageVal = StorageManager.getBooleanValue('showStockThumbnails');
|
||||||
|
|
||||||
|
this.showStockThumbnails = storageVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user