From 5ad5464dd1ba941ef7b315f74f0832e99662279b Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 11 Feb 2015 23:23:37 -0800 Subject: [PATCH] Fetch messages in the background --- js/panel_controller.js | 1 + js/views/conversation_view.js | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/js/panel_controller.js b/js/panel_controller.js index 9d6bc2b2..955e16b6 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -36,6 +36,7 @@ window.openConversation = function openConversation (modelId) { var conversation = conversations.add({id: modelId}); conversation.fetch(); + conversation.fetchMessages(); var windowId = windowMap.windowIdFrom(modelId); diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 9779d7f3..32845aa5 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -39,14 +39,6 @@ }); this.$el.find('.discussion-container').append(this.view.el); - if (this.model.id) { - this.model.fetchMessages({reset: true}); - } - - extension.on('message', function() { - this.model.fetchMessages(); - }.bind(this)); - window.addEventListener('resize', this.view.resize.bind(this.view)); },