Stop calling updateInbox all the time
Now that the inbox collection keeps itself in sync, we don't have the data duplication that was forcing us to reload constantly. // FREEBIE
This commit is contained in:
parent
537f0ceef0
commit
b617240338
2 changed files with 2 additions and 14 deletions
|
@ -89,8 +89,6 @@
|
|||
active_at : now,
|
||||
timestamp : now,
|
||||
lastMessage : body
|
||||
}).then(function() {
|
||||
ConversationController.updateInbox();
|
||||
});
|
||||
|
||||
var sendFunc;
|
||||
|
@ -113,9 +111,7 @@
|
|||
}
|
||||
});
|
||||
if (keyErrors.length) {
|
||||
message.save({ errors : keyErrors }).then(function() {
|
||||
ConversationController.updateInbox();
|
||||
});
|
||||
message.save({ errors : keyErrors });
|
||||
} else {
|
||||
if (!(errors instanceof Array)) {
|
||||
errors = [errors];
|
||||
|
@ -198,18 +194,11 @@
|
|||
}.bind(this));
|
||||
},
|
||||
|
||||
archive: function() {
|
||||
this.set({active_at: null});
|
||||
},
|
||||
|
||||
destroyMessages: function() {
|
||||
var models = this.messageCollection.models;
|
||||
this.messageCollection.reset([]);
|
||||
_.each(models, function(message) { message.destroy(); });
|
||||
this.archive();
|
||||
return this.save().then(function() {
|
||||
ConversationController.updateInbox();
|
||||
});
|
||||
this.save({active_at: null}); // archive
|
||||
},
|
||||
|
||||
getTitle: function() {
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
});
|
||||
} else {
|
||||
openConversation(conversation);
|
||||
ConversationController.updateInbox();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue