Skip to content

Commit

Permalink
fix: rebuild node routes doesn't update status on node object (#3391)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Oct 30, 2023
1 parent c36ebc8 commit 8f00446
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3187,12 +3187,22 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
async rebuildNodeRoutes(nodeId: number): Promise<boolean> {
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],
])
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/stores/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
Expand Down

0 comments on commit 8f00446

Please sign in to comment.