Fixes logic to detect when a thing's config changes vs the whole thing structure (#2729)

Fixes #2704

---------

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
pull/2730/head
Dan Cunningham 2024-08-25 00:17:40 -07:00 committed by GitHub
parent 6139039f6c
commit 77dbfcb198
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 4 deletions

View File

@ -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