Skip to content

Commit

Permalink
Keep conversation.lastMessage in memory
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Sep 20, 2018
1 parent ecb126e commit 3464eb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions js/models/conversations.js
Expand Up @@ -782,11 +782,12 @@
});

const message = this.addSingleMessage(messageWithSchema);
this.lastMessage = message.getNotificationText();
this.lastMessageStatus = 'sending';

this.save({
active_at: now,
timestamp: now,
lastMessage: message.getNotificationText(),
lastMessageStatus: 'sending',
});

if (this.isPrivate()) {
Expand Down
2 changes: 1 addition & 1 deletion js/models/messages.js
Expand Up @@ -1205,8 +1205,8 @@
!conversationTimestamp ||
message.get('sent_at') > conversationTimestamp
) {
conversation.lastMessage = message.getNotificationText();
conversation.set({
lastMessage: message.getNotificationText(),
timestamp: message.get('sent_at'),
});
}
Expand Down

0 comments on commit 3464eb6

Please sign in to comment.