Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rebuild node routes doesn't update status on node object #3391

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading