diff --git a/js/background.js b/js/background.js index 755277c6c..2dcf141bb 100644 --- a/js/background.js +++ b/js/background.js @@ -132,13 +132,13 @@ var message = initIncomingMessage(envelope.source, envelope.timestamp.toNumber()); if (e.name === 'IncomingIdentityKeyError') { message.save({ errors : [e] }).then(function() { - updateInbox(); + ConversationController.updateInbox(); notifyConversation(message); }); return; } else if (e.message !== 'Bad MAC') { message.save({ errors : [ _.pick(e, ['name', 'message'])]}).then(function() { - updateInbox(); + ConversationController.updateInbox(); notifyConversation(message); }); return; diff --git a/js/models/conversations.js b/js/models/conversations.js index b32ff1968..b09631212 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -72,7 +72,7 @@ timestamp : now, lastMessage : body }).then(function() { - updateInbox(); + ConversationController.updateInbox(); }); var sendFunc; @@ -96,7 +96,7 @@ }); if (keyErrors.length) { message.save({ errors : keyErrors }).then(function() { - updateInbox(); + ConversationController.updateInbox(); }); } else { if (!(errors instanceof Array)) { @@ -188,7 +188,7 @@ _.each(models, function(message) { message.destroy(); }); this.archive(); return this.save().then(function() { - updateInbox(); + ConversationController.updateInbox(); }); }, diff --git a/js/panel_controller.js b/js/panel_controller.js index a89564d41..f5b708d6b 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -63,10 +63,6 @@ } }; - window.updateInbox = function() { // TODO: remove - ConversationController.updateInbox(); - }; - ConversationController.updateInbox(); setUnreadCount(storage.get("unreadCount", 0));