Model manager and sync updates
This commit is contained in:
@@ -165,8 +165,6 @@ class ModelManager {
|
||||
}
|
||||
|
||||
addItems(items) {
|
||||
this.items = _.uniq(this.items.concat(items));
|
||||
|
||||
items.forEach(function(item){
|
||||
if(item.content_type == "Tag") {
|
||||
if(!_.find(this.tags, {uuid: item.uuid})) {
|
||||
@@ -184,6 +182,10 @@ class ModelManager {
|
||||
this._extensions.unshift(item);
|
||||
}
|
||||
}
|
||||
|
||||
if(!_.find(this.items, {uuid: item.uuid})) {
|
||||
this.items.push(item);
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
@@ -203,7 +205,7 @@ class ModelManager {
|
||||
|
||||
// If another client removes an item's references, this client won't pick up the removal unless
|
||||
// we remove everything not present in the current list of references
|
||||
item.removeReferencesNotPresentIn(contentObject.references);
|
||||
item.removeReferencesNotPresentIn(contentObject.references || []);
|
||||
|
||||
if(!contentObject.references) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user