From 0509bb0f5d229df81f5e5869ed4b5b08138ce9d1 Mon Sep 17 00:00:00 2001 From: lilia Date: Mon, 7 Sep 2015 17:32:20 -0700 Subject: [PATCH] Remove global updateInbox, used scoped version // FREEBIE --- js/background.js | 4 ++-- js/models/conversations.js | 6 +++--- js/panel_controller.js | 4 ---- 3 files changed, 5 insertions(+), 9 deletions(-) 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));