Skip to content

Commit

Permalink
Fixed an issue where a service attribute was used instead of the wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleeckx committed Mar 10, 2017
1 parent 7a67de7 commit 478809e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Libs/Vidyano/persistent-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
let isDirty = false;

this.attributes.removeAll(attr => {
if (!result.attributes.some(a => a.id === attr.id)) {
if (!result.attributes.some(serviceAttr => serviceAttr.id === attr.id)) {
delete this.attributes[attr.name];
attr.parent = null;
changedAttributes.push(attr);
Expand All @@ -355,7 +355,7 @@
});

this.attributes.forEach(attr => {
let serviceAttr = Enumerable.from(result.attributes).firstOrDefault(a => a.id === attr.id);
let serviceAttr = Enumerable.from(result.attributes).firstOrDefault(serviceAttr => serviceAttr.id === attr.id);
if (serviceAttr) {
if (!(serviceAttr instanceof PersistentObjectAttribute))
serviceAttr = this._createPersistentObjectAttribute(serviceAttr);
Expand All @@ -368,8 +368,9 @@
isDirty = true;
});

result.attributes.forEach(attr => {
if (!this.attributes.some(a => a.id === attr.id)) {
result.attributes.forEach(serviceAttr => {
if (!this.attributes.some(a => a.id === serviceAttr.id)) {
const attr = this._createPersistentObjectAttribute(serviceAttr);
this.attributes.push(attr);
attr.parent = this;

Expand Down

0 comments on commit 478809e

Please sign in to comment.