From aebf4b32d61133a79be17ea336af74e6b9ced2f9 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 15 Jun 2017 16:11:31 -0700 Subject: [PATCH] Conversation.updateLastMessage: fix indent, use of null message FREEBIE --- js/models/conversations.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/models/conversations.js b/js/models/conversations.js index 9cfa72e74..8ec147f04 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -409,16 +409,16 @@ var collection = new Whisper.MessageCollection(); return collection.fetchConversation(this.id, 1).then(function() { var lastMessage = collection.at(0); - if (lastMessage.get('type') === 'verified-change') { - return; - } if (lastMessage) { - this.set({ - lastMessage : lastMessage.getNotificationText(), - timestamp : lastMessage.get('sent_at') - }); + if (lastMessage.get('type') === 'verified-change') { + return; + } + this.set({ + lastMessage : lastMessage.getNotificationText(), + timestamp : lastMessage.get('sent_at') + }); } else { - this.set({ lastMessage: '', timestamp: null }); + this.set({ lastMessage: '', timestamp: null }); } if (this.hasChanged('lastMessage') || this.hasChanged('timestamp')) { this.save();