mirror of
https://github.com/nasa/openmct.git
synced 2025-04-23 02:13:52 +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:
parent
6de973c11e
commit
5faf81e9a5
@ -59,7 +59,11 @@ define(
|
||||
// Allow mutators to change their mind by
|
||||
// returning 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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user