Don't fetch messages from the background
Only fetch them from a frontend view. If the conversation is not open, we don't need to load the messages, and if we do load them, they will render before we've done the initial contact info loading (as implemented in 74e96ce). Fixes #344 // FREEBIE
This commit is contained in:
@@ -155,7 +155,7 @@
|
||||
function updateConversation(conversationId) {
|
||||
var conversation = ConversationController.get(conversationId);
|
||||
if (conversation) {
|
||||
conversation.fetchMessages();
|
||||
conversation.trigger('newmessages');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -87,7 +87,7 @@
|
||||
conversation.fetch();
|
||||
}
|
||||
if (inboxOpened) {
|
||||
conversation.fetchMessages();
|
||||
conversation.trigger('newmessages');
|
||||
extension.windows.drawAttention(inboxWindowId);
|
||||
} else if (Whisper.Notifications.isEnabled()) {
|
||||
var sender = ConversationController.create({id: message.get('source')});
|
||||
|
@@ -23,6 +23,7 @@
|
||||
initialize: function(options) {
|
||||
this.listenTo(this.model, 'destroy', this.stopListening);
|
||||
this.listenTo(this.model, 'change:name', this.updateTitle);
|
||||
this.listenTo(this.model, 'newmessages', this.fetchMessages);
|
||||
|
||||
this.render();
|
||||
|
||||
@@ -79,6 +80,9 @@
|
||||
'select .entry': 'messageDetail',
|
||||
'force-resize': 'forceUpdateMessageFieldSize'
|
||||
},
|
||||
fetchMessages: function() {
|
||||
this.model.fetchMessages();
|
||||
},
|
||||
|
||||
viewMembers: function() {
|
||||
var view = new Whisper.GroupMemberList({ model: this.model });
|
||||
|
Reference in New Issue
Block a user