mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 17:08:57 +00:00
[Edit] Only persist on mutation if model has actually changed locally. Fixes #1482
This commit is contained in:
@ -148,13 +148,19 @@ define(
|
||||
*/
|
||||
PersistenceCapability.prototype.refresh = function () {
|
||||
var domainObject = this.domainObject;
|
||||
var $q = this.$q;
|
||||
|
||||
// Update a domain object's model upon refresh
|
||||
function updateModel(model) {
|
||||
var modified = model.modified;
|
||||
return domainObject.useCapability("mutation", function () {
|
||||
return model;
|
||||
}, modified);
|
||||
if (model === undefined) {
|
||||
//Get failed, reject promise
|
||||
return $q.reject('Got empty object model');
|
||||
} else {
|
||||
var modified = model.modified;
|
||||
return domainObject.useCapability("mutation", function () {
|
||||
return model;
|
||||
}, modified);
|
||||
}
|
||||
}
|
||||
|
||||
if (domainObject.getModel().persisted === undefined) {
|
||||
|
Reference in New Issue
Block a user