mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 07:38:15 +00:00
[Layout] Handle mutation edge case
Fix an edge case in the mutation capability where model data could be lost during a mutation; this supports auto-mutate/persist functionality for representations, which allows Layout editing (transitioned for WTD-535) to be persisted thereby.
This commit is contained in:
@ -59,7 +59,11 @@ define(
|
|||||||
// Allow mutators to change their mind by
|
// Allow mutators to change their mind by
|
||||||
// returning false.
|
// returning false.
|
||||||
if (mutationResult !== false) {
|
if (mutationResult !== false) {
|
||||||
copyValues(model, result);
|
// Copy values if result was a different object
|
||||||
|
// (either our clone or some other new thing)
|
||||||
|
if (model !== result) {
|
||||||
|
copyValues(model, result);
|
||||||
|
}
|
||||||
model.modified = Date.now();
|
model.modified = Date.now();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user