mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 05:37:53 +00:00
[Persistence] Handle refresh after edit
Correctly handle Discard changes after leaving Edit mode when conflicts are detected; WTD-1033.
This commit is contained in:
parent
6b43256afd
commit
0090732f71
@ -29,6 +29,13 @@ define(
|
||||
cache.markDirty(editableObject);
|
||||
};
|
||||
|
||||
// Delegate refresh to the original object; this avoids refreshing
|
||||
// the editable instance of the object, and ensures that refresh
|
||||
// correctly targets the "real" version of the object.
|
||||
persistence.refresh = function () {
|
||||
return domainObject.getCapability('persistence').refresh();
|
||||
};
|
||||
|
||||
return persistence;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ define(
|
||||
|
||||
// Persist the underlying domain object
|
||||
function doPersist() {
|
||||
return persistenceCapability.persist();
|
||||
return domainObject.getCapability('persistence').persist();
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -62,7 +62,9 @@ define(
|
||||
|
||||
// Discard changes for a failed refresh
|
||||
function discard(failure) {
|
||||
return failure.persistence.refresh(true);
|
||||
var persistence =
|
||||
failure.domainObject.getCapability('persistence');
|
||||
return persistence.refresh();
|
||||
}
|
||||
|
||||
// Discard changes associated with a failed save
|
||||
|
Loading…
Reference in New Issue
Block a user