From 77dbfcb198d20053b55373f32255f2a50eaa2ff7 Mon Sep 17 00:00:00 2001 From: Dan Cunningham Date: Sun, 25 Aug 2024 00:17:40 -0700 Subject: [PATCH] Fixes logic to detect when a thing's config changes vs the whole thing structure (#2729) Fixes #2704 --------- Signed-off-by: Dan Cunningham --- .../src/pages/settings/things/thing-details.vue | 14 ++++++++++---- 1 file changed, 10 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 9497bed0c..34e89d8ca 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 @@ -350,11 +350,17 @@ export default { // create rule object clone in order to be able to delete status part // which can change from eventsource but doesn't mean a rule modification let thingClone = cloneDeep(this.thing) - delete thingClone.statusInfo - delete this.savedThing.statusInfo + let savedThingClone = cloneDeep(this.savedThing) - this.configDirty = !fastDeepEqual(thingClone.configuration, this.savedThing.configuration) - this.thingDirty = !fastDeepEqual(thingClone, this.savedThing) + // check if the configuration has changed between the thing and the original/saved version + this.configDirty = !fastDeepEqual(thingClone.configuration, savedThingClone.configuration) + + // check if the rest of the thing has changed between the thing and the original/saved version + delete thingClone.statusInfo + delete thingClone.configuration + delete savedThingClone.statusInfo + delete savedThingClone.configuration + this.thingDirty = !fastDeepEqual(thingClone, savedThingClone) } }, deep: true