[Core] Revise explicit setting of modified timestamp

Allow undefined as an explicit value for a domain
object's modification timestamp (as set via the
mutation capability.) Avoids a bug in minimal auto-refresh,
being added for WTD-1221.
This commit is contained in:
Victor Woeltjen
2015-06-03 13:09:23 -07:00
parent 28805cd55c
commit e452921729

View File

@ -77,7 +77,8 @@ define(
// Get the object's model and clone it, so the // Get the object's model and clone it, so the
// mutator function has a temporary copy to work with. // mutator function has a temporary copy to work with.
var model = domainObject.getModel(), var model = domainObject.getModel(),
clone = JSON.parse(JSON.stringify(model)); clone = JSON.parse(JSON.stringify(model)),
useTimestamp = arguments.length > 1;
// Function to handle copying values to the actual // Function to handle copying values to the actual
function handleMutation(mutationResult) { function handleMutation(mutationResult) {
@ -94,8 +95,7 @@ define(
if (model !== result) { if (model !== result) {
copyValues(model, result); copyValues(model, result);
} }
model.modified = (typeof timestamp === 'number') ? model.modified = useTimestamp ? timestamp : now();
timestamp : now();
} }
// Report the result of the mutation // Report the result of the mutation