[#3389] Set the persisted timestamp to date.now rather than the domain object's modified timestamp (#3390)

This commit is contained in:
Shefali Joshi
2020-09-22 11:34:06 -07:00
committed by GitHub
parent 08b2940eb6
commit 7879752f47
2 changed files with 12 additions and 9 deletions

View File

@@ -200,17 +200,19 @@ define([
} else if (hasAlreadyBeenPersisted(domainObject)) {
result = Promise.resolve(true);
} else {
const persistedTime = Date.now();
if (domainObject.persisted === undefined) {
domainObject.persisted = domainObject.modified;
result = new Promise((resolve) => {
savedResolve = resolve;
});
domainObject.persisted = persistedTime;
provider.create(domainObject).then((response) => {
this.mutate(domainObject, 'persisted', domainObject.modified);
this.mutate(domainObject, 'persisted', persistedTime);
savedResolve(response);
});
} else {
this.mutate(domainObject, 'persisted', domainObject.modified);
domainObject.persisted = persistedTime;
this.mutate(domainObject, 'persisted', persistedTime);
result = provider.update(domainObject);
}
}