From 6a17c28e4d559a0429d0844bdde31d4dd50f5193 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Tue, 1 Oct 2024 11:19:48 +0200 Subject: [PATCH] Thing details: Fix config action saves the whole Thing (#2775) A Thing config action is only supposed to save the config of the Thing, not the whole Thing. Fixes https://github.com/openhab/openhab-core/issues/4380. Signed-off-by: Florian Hotze (cherry picked from commit d78e6d94703ef806b9d4d5c49cd7f1a3f6cd09d6) --- .../web/src/pages/settings/things/thing-details.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue b/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue index 26eb7e21fe..c4e90e65a9 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue @@ -541,8 +541,6 @@ export default { }) }, doConfigAction (action) { - let thing = this.thing - let save = this.save if (action.type !== 'BOOLEAN') { console.warn('Invalid action type', action) return @@ -558,8 +556,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() } ) },