Merged master
This commit is contained in:
@@ -371,7 +371,7 @@ class ComponentManager {
|
|||||||
// push immediately now
|
// push immediately now
|
||||||
var items = [];
|
var items = [];
|
||||||
for(var contentType of message.data.content_types) {
|
for(var contentType of message.data.content_types) {
|
||||||
items = items.concat(this.modelManager.itemsForContentType(contentType));
|
items = items.concat(this.modelManager.validItemsForContentType(contentType));
|
||||||
}
|
}
|
||||||
this.sendItemsInReply(component, items, message);
|
this.sendItemsInReply(component, items, message);
|
||||||
});
|
});
|
||||||
@@ -499,8 +499,9 @@ class ComponentManager {
|
|||||||
|
|
||||||
this.syncManager.sync("handleCreateItemMessage");
|
this.syncManager.sync("handleCreateItemMessage");
|
||||||
|
|
||||||
|
// "create-item" or "create-items" are possible messages handled here
|
||||||
let reply =
|
let reply =
|
||||||
message.action == "save-item" ?
|
message.action == "create-item" ?
|
||||||
{item: this.jsonForItem(processedItems[0], component)}
|
{item: this.jsonForItem(processedItems[0], component)}
|
||||||
:
|
:
|
||||||
{items: processedItems.map((item) => {return this.jsonForItem(item, component)})}
|
{items: processedItems.map((item) => {return this.jsonForItem(item, component)})}
|
||||||
|
|||||||
@@ -102,9 +102,9 @@ class ModelManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
itemsForContentType(contentType) {
|
validItemsForContentType(contentType) {
|
||||||
return this.allItems.filter(function(item){
|
return this.allItems.filter((item) => {
|
||||||
return item.content_type == contentType;
|
return item.content_type == contentType && !item.errorDecrypting;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +185,11 @@ class ModelManager {
|
|||||||
|
|
||||||
this.addItem(item, isDirtyItemPendingDelete);
|
this.addItem(item, isDirtyItemPendingDelete);
|
||||||
|
|
||||||
modelsToNotifyObserversOf.push(item);
|
// Observers do not need to handle items that errored while decrypting.
|
||||||
|
if(!item.errorDecrypting) {
|
||||||
|
modelsToNotifyObserversOf.push(item);
|
||||||
|
}
|
||||||
|
|
||||||
models.push(item);
|
models.push(item);
|
||||||
processedObjects.push(json_obj);
|
processedObjects.push(json_obj);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user