Conversation.updateLastMessage: fix indent, use of null message
FREEBIE
This commit is contained in:
parent
36c28296e9
commit
aebf4b32d6
1 changed files with 8 additions and 8 deletions
|
@ -409,16 +409,16 @@
|
||||||
var collection = new Whisper.MessageCollection();
|
var collection = new Whisper.MessageCollection();
|
||||||
return collection.fetchConversation(this.id, 1).then(function() {
|
return collection.fetchConversation(this.id, 1).then(function() {
|
||||||
var lastMessage = collection.at(0);
|
var lastMessage = collection.at(0);
|
||||||
if (lastMessage.get('type') === 'verified-change') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (lastMessage) {
|
if (lastMessage) {
|
||||||
this.set({
|
if (lastMessage.get('type') === 'verified-change') {
|
||||||
lastMessage : lastMessage.getNotificationText(),
|
return;
|
||||||
timestamp : lastMessage.get('sent_at')
|
}
|
||||||
});
|
this.set({
|
||||||
|
lastMessage : lastMessage.getNotificationText(),
|
||||||
|
timestamp : lastMessage.get('sent_at')
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.set({ lastMessage: '', timestamp: null });
|
this.set({ lastMessage: '', timestamp: null });
|
||||||
}
|
}
|
||||||
if (this.hasChanged('lastMessage') || this.hasChanged('timestamp')) {
|
if (this.hasChanged('lastMessage') || this.hasChanged('timestamp')) {
|
||||||
this.save();
|
this.save();
|
||||||
|
|
Loading…
Add table
Reference in a new issue