mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 23:28:14 +00:00
[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:
@ -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
|
||||||
|
Reference in New Issue
Block a user