Skip to content

Commit

Permalink
Thing details: Fix config action saves the whole Thing (#2775)
Browse files Browse the repository at this point in the history
A Thing config action is only supposed to save the config of the Thing,
not the whole Thing.

Fixes openhab/openhab-core#4380.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 authored Oct 1, 2024
1 parent bdb54a5 commit d78e6d9
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,6 @@ export default {
})
},
doConfigAction (action) {
let thing = this.thing
let save = this.save
if (action.type !== 'BOOLEAN') {
console.warn('Invalid action type', action)
return
Expand All @@ -564,8 +562,15 @@ export default {
prompt,
this.thing.label,
() => {
thing.configuration[action.name] = true
save()
const name = action.name
// Make sure Vue reactivity notices the change
this.$set(this.thing, 'configuration', ({
name: true,
...this.thing.configuration
}))
// Vue reactivity is too slow to recognize config change before the API call, manually mark the config dirty
this.configDirty = true
this.save()
}
)
},
Expand Down

0 comments on commit d78e6d9

Please sign in to comment.