FIX: Reset dirtyState on dis(connect)

This commit is contained in:
Robert Kossessa
2024-03-22 16:02:35 +01:00
parent 4eef25654d
commit 8b370b5e17

View File

@@ -197,6 +197,7 @@ export const useDeviceStore = defineStore('device', {
connectDevice(deviceId: string | undefined = undefined, updateDevice: boolean = true) { connectDevice(deviceId: string | undefined = undefined, updateDevice: boolean = true) {
if (deviceId) { if (deviceId) {
this.currentDeviceId = deviceId this.currentDeviceId = deviceId
this.setDirtyState(false)
if (updateDevice) { if (updateDevice) {
nanoIpc.connect(deviceId) nanoIpc.connect(deviceId)
} }
@@ -206,6 +207,7 @@ export const useDeviceStore = defineStore('device', {
}, },
disconnectDevice(deviceId: string, updateDevice: boolean = true) { disconnectDevice(deviceId: string, updateDevice: boolean = true) {
this.currentDeviceId = null this.currentDeviceId = null
this.setDirtyState(false)
if (updateDevice) { if (updateDevice) {
nanoIpc.disconnect(deviceId) nanoIpc.disconnect(deviceId)
} }