diff --git a/js/conversation_controller.js b/js/conversation_controller.js index 24ab144bf1..eb961c680e 100644 --- a/js/conversation_controller.js +++ b/js/conversation_controller.js @@ -57,6 +57,7 @@ }))(); window.getInboxCollection = () => inboxCollection; + window.getConversations = () => conversations; const contactCollection = new (Backbone.Collection.extend({ initialize() { diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js index 9782d4a202..6c93be31f7 100644 --- a/js/views/inbox_view.js +++ b/js/views/inbox_view.js @@ -1,5 +1,6 @@ /* global extension, + getConversations, getInboxCollection, i18n, Whisper, @@ -137,8 +138,8 @@ }, setupLeftPane() { // Here we set up a full redux store with initial state for our LeftPane Root - const inboxCollection = getInboxCollection(); - const conversations = inboxCollection.map( + const convoCollection = getConversations(); + const conversations = convoCollection.map( conversation => conversation.cachedProps ); @@ -180,19 +181,19 @@ this.openConversationAction = openConversationExternal; - this.listenTo(inboxCollection, 'remove', conversation => { + this.listenTo(convoCollection, 'remove', conversation => { const { id } = conversation || {}; conversationRemoved(id); }); - this.listenTo(inboxCollection, 'add', conversation => { + this.listenTo(convoCollection, 'add', conversation => { const { id, cachedProps } = conversation || {}; conversationAdded(id, cachedProps); }); - this.listenTo(inboxCollection, 'change', conversation => { + this.listenTo(convoCollection, 'change', conversation => { const { id, cachedProps } = conversation || {}; conversationChanged(id, cachedProps); }); - this.listenTo(inboxCollection, 'reset', removeAllConversations); + this.listenTo(convoCollection, 'reset', removeAllConversations); Whisper.events.on('messageExpired', messageExpired); Whisper.events.on('userChanged', userChanged);