From b617240338bf96191525d30077269d7e343dbf8e Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 16 Sep 2015 23:48:51 -0700 Subject: [PATCH] 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 --- js/models/conversations.js | 15 ++------------- js/panel_controller.js | 1 - 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/js/models/conversations.js b/js/models/conversations.js index 2d3ee1894555..6d3802e7434a 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -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() { diff --git a/js/panel_controller.js b/js/panel_controller.js index 692c771cfd73..b5cd2a0bd33f 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -50,7 +50,6 @@ }); } else { openConversation(conversation); - ConversationController.updateInbox(); } };