Revert "[Edit Mode] Fix issue with navigation not triggering unsaved changes message for new objects. Removed logic that prevented mutation of new objects from triggering a transactional persist call. Fixes #1278"

This reverts commit 7dda85cc5f.
This commit is contained in:
Henry 2016-12-05 15:49:50 -08:00
parent 7dda85cc5f
commit 86b337ec88

View File

@ -40,17 +40,19 @@ define([], function () {
var wasActive = transactionService.isActive(); var wasActive = transactionService.isActive();
cacheService.put(domainObject.getId(), domainObject.getModel()); cacheService.put(domainObject.getId(), domainObject.getModel());
if (!wasActive) { if (persistence.persisted()) {
transactionService.startTransaction(); if (!wasActive) {
} transactionService.startTransaction();
}
transactionService.addToTransaction( transactionService.addToTransaction(
persistence.persist.bind(persistence), persistence.persist.bind(persistence),
persistence.refresh.bind(persistence) persistence.refresh.bind(persistence)
); );
if (!wasActive) { if (!wasActive) {
transactionService.commit(); transactionService.commit();
}
} }
}); });
} }