Skip to content

Commit e3a6872

Browse files
author
robin
committed
Also copy store changes
1 parent e354afa commit e3a6872

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

dist/mobx-spine.cjs.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,8 @@ var Model = (_class$1 = (_temp$1 = _class2$1 = function () {
12501250
if (source[relation].hasUserChanges) {
12511251
if (source[relation].models) {
12521252
// If related item is a store
1253+
// Check if the store has some changes
1254+
_this6[relation].__setChanged = source[relation].__setChanged;
12531255
// Set the changes for all related models with changes
12541256
source[relation].models.forEach(function (relatedModel, index) {
12551257
_this6[relation].models[index].__copyChanges(relatedModel, _this6[relation]);

dist/mobx-spine.es.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,8 @@ var Model = (_class$1 = (_temp$1 = _class2$1 = function () {
12441244
if (source[relation].hasUserChanges) {
12451245
if (source[relation].models) {
12461246
// If related item is a store
1247+
// Check if the store has some changes
1248+
_this6[relation].__setChanged = source[relation].__setChanged;
12471249
// Set the changes for all related models with changes
12481250
source[relation].models.forEach(function (relatedModel, index) {
12491251
_this6[relation].models[index].__copyChanges(relatedModel, _this6[relation]);

src/Model.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,8 @@ export default class Model {
490490
if (this[relation]) {
491491
if (source[relation].hasUserChanges) {
492492
if (source[relation].models) { // If related item is a store
493+
// Check if the store has some changes
494+
this[relation].__setChanged = source[relation].__setChanged;
493495
// Set the changes for all related models with changes
494496
source[relation].models.forEach((relatedModel, index) => {
495497
this[relation].models[index].__copyChanges(relatedModel, this[relation]);

0 commit comments

Comments
 (0)