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
parent
6139039f6c
commit
77dbfcb198
|
@ -350,11 +350,17 @@ export default {
|
||||||
// create rule object clone in order to be able to delete status part
|
// 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
|
// which can change from eventsource but doesn't mean a rule modification
|
||||||
let thingClone = cloneDeep(this.thing)
|
let thingClone = cloneDeep(this.thing)
|
||||||
delete thingClone.statusInfo
|
let savedThingClone = cloneDeep(this.savedThing)
|
||||||
delete this.savedThing.statusInfo
|
|
||||||
|
|
||||||
this.configDirty = !fastDeepEqual(thingClone.configuration, this.savedThing.configuration)
|
// check if the configuration has changed between the thing and the original/saved version
|
||||||
this.thingDirty = !fastDeepEqual(thingClone, this.savedThing)
|
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
|
deep: true
|
||||||
|
|
Loading…
Reference in New Issue