Skip to content
Snippets Groups Projects
Commit f4b31c73 authored by Arkerthan's avatar Arkerthan
Browse files

fix diff proxy making properties inaccessible when properties on the same object where changed

parent 3a289cce
No related branches found
No related tags found
1 merge request!10135Fix and QoL
......@@ -2,6 +2,8 @@
* The diff proxy records all changes to the original object without changing the original object while emulating the
* changes for access from outside. The resulting diff object can then be applied on the original. The resulting object
* is the same as if the changes were applied directly to the original object.
*
* NOTE: When doing any changes to this, rerun the tests cases at devNotes/tests.
*/
App.Utils.Diff = (function() {
const deletedSymbol = Symbol("deleted property");
......@@ -64,7 +66,8 @@ App.Utils.Diff = (function() {
// Deep copy in case array entries get modified later
localDiff[key] = _.cloneDeep(original);
} else if (_.isObject(original)) {
localDiff[key] = {};
// TODO check if there is a way to keep the data structure valid without the need for deep clone
localDiff[key] = _.cloneDeep(original);
}
}
localDiff = localDiff[key];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment