Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nasa/openmct.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/objects/MutableDomainObject.js')
-rw-r--r--src/api/objects/MutableDomainObject.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/api/objects/MutableDomainObject.js b/src/api/objects/MutableDomainObject.js
index 046f8b069..df0965d3b 100644
--- a/src/api/objects/MutableDomainObject.js
+++ b/src/api/objects/MutableDomainObject.js
@@ -75,11 +75,7 @@ class MutableDomainObject {
return eventOff;
}
$set(path, value) {
- _.set(this, path, value);
-
- if (path !== 'persisted' && path !== 'modified') {
- _.set(this, 'modified', Date.now());
- }
+ MutableDomainObject.mutateObject(this, path, value);
//Emit secret synchronization event first, so that all objects are in sync before subsequent events fired.
this._globalEventEmitter.emit(qualifiedEventName(this, '$_synchronize_model'), this);
@@ -136,8 +132,11 @@ class MutableDomainObject {
}
static mutateObject(object, path, value) {
+ if (path !== 'persisted') {
+ _.set(object, 'modified', Date.now());
+ }
+
_.set(object, path, value);
- _.set(object, 'modified', Date.now());
}
}