Fixes altnernate uuids on sign in to notify observers, fixes dummy note becoming undummy

This commit is contained in:
Mo Bitar
2018-01-12 16:38:26 -06:00
parent c7ce308a19
commit a679f82859
8 changed files with 27 additions and 25 deletions

View File

@@ -62,9 +62,10 @@ class ModelManager {
}
if(removeOriginal) {
this.removeItemLocally(item, function(){
block();
});
// Set to deleted, then run through mapping function so that observers can be notified
item.deleted = true;
this.mapResponseItemsToLocalModels([item], ModelManager.MappingSourceLocalSaved);
block();
} else {
block();
}
@@ -81,13 +82,13 @@ class ModelManager {
}
allItemsMatchingTypes(contentTypes) {
return this.items.filter(function(item){
return this.allItems.filter(function(item){
return (_.includes(contentTypes, item.content_type) || _.includes(contentTypes, "*")) && !item.dummy;
})
}
itemsForContentType(contentType) {
return this.items.filter(function(item){
return this.allItems.filter(function(item){
return item.content_type == contentType;
});
}