ADD: Persist devicePreviewModel

This commit is contained in:
Robert Kossessa
2024-03-02 16:12:27 +01:00
parent 6e02fa4ac5
commit bee6ab1076

View File

@@ -50,7 +50,7 @@ export const useStore = defineStore('main', {
} }
} }
}, },
previewDeviceModel: 'nanoOne', previewDeviceModel: localStorage.getItem('previewDeviceModel') || 'nanoOne',
screenOrientation: 90, screenOrientation: 90,
// device state as received from the device // device state as received from the device
@@ -197,6 +197,7 @@ export const useStore = defineStore('main', {
}, },
switchPreviewDeviceModel() { switchPreviewDeviceModel() {
this.previewDeviceModel = this.previewDeviceModel === 'nanoOne' ? 'nanoZero' : 'nanoOne' this.previewDeviceModel = this.previewDeviceModel === 'nanoOne' ? 'nanoZero' : 'nanoOne'
localStorage.setItem('previewDeviceModel', this.previewDeviceModel)
}, },
cycleScreenOrientation() { cycleScreenOrientation() {
this.screenOrientation = (this.screenOrientation + 90) % 360 this.screenOrientation = (this.screenOrientation + 90) % 360