From 7dda85cc5f2783c2665ee2c65ce8bdc6a8adccce Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 5 Dec 2016 15:46:56 -0800 Subject: [PATCH] [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 --- .../src/runs/TransactingMutationListener.js | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/platform/core/src/runs/TransactingMutationListener.js b/platform/core/src/runs/TransactingMutationListener.js index aba0cd5b28..d9f6d074f7 100644 --- a/platform/core/src/runs/TransactingMutationListener.js +++ b/platform/core/src/runs/TransactingMutationListener.js @@ -40,19 +40,17 @@ define([], function () { var wasActive = transactionService.isActive(); cacheService.put(domainObject.getId(), domainObject.getModel()); - if (persistence.persisted()) { - if (!wasActive) { - transactionService.startTransaction(); - } + if (!wasActive) { + transactionService.startTransaction(); + } - transactionService.addToTransaction( - persistence.persist.bind(persistence), - persistence.refresh.bind(persistence) - ); + transactionService.addToTransaction( + persistence.persist.bind(persistence), + persistence.refresh.bind(persistence) + ); - if (!wasActive) { - transactionService.commit(); - } + if (!wasActive) { + transactionService.commit(); } }); }