From 8f00446949e1800791099487dfc4ab6890376a71 Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Mon, 30 Oct 2023 12:14:29 +0100 Subject: [PATCH] fix: rebuild node routes doesn't update status on node object (#3391) --- lib/ZwaveClient.ts | 10 ++++++++++ src/App.vue | 2 +- src/stores/base.js | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/ZwaveClient.ts b/lib/ZwaveClient.ts index 26db1f3a06..5844279830 100644 --- a/lib/ZwaveClient.ts +++ b/lib/ZwaveClient.ts @@ -3187,12 +3187,22 @@ class ZwaveClient extends TypedEventEmitter { async rebuildNodeRoutes(nodeId: number): Promise { if (this.driverReady) { let status: RebuildRoutesStatus = 'pending' + + const node = this.nodes.get(nodeId) + + if (!node) { + throw Error(`Node ${nodeId} not found`) + } + + node.rebuildRoutesProgress = status this.sendToSocket(socketEvents.rebuildRoutesProgress, [ [nodeId, status], ]) const result = await this._driver.controller.rebuildNodeRoutes(nodeId) status = result ? 'done' : 'failed' + + node.rebuildRoutesProgress = status this.sendToSocket(socketEvents.rebuildRoutesProgress, [ [nodeId, status], ]) diff --git a/src/App.vue b/src/App.vue index 57081c9412..653235a89f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -433,7 +433,7 @@ export default { this.startSocket() }, darkMode(val) { - this.$vuetify.theme.dark = val || false + this.$vuetify.theme.dark = !!val }, controllerNode(node) { if (!node) return diff --git a/src/stores/base.js b/src/stores/base.js index 56e2f584d2..e09c4731e9 100644 --- a/src/stores/base.js +++ b/src/stores/base.js @@ -97,7 +97,7 @@ const useBaseStore = defineStore('base', { newConfigVersion: undefined, }, ui: { - darkMode: settings.load('dark', undefined), // do not set a default here, otherwise the watch in App.vue will not trigger the change + darkMode: settings.load('dark', false), navTabs: settings.load('navTabs', false), compactMode: settings.load('compact', false), },