Ensure that we never show last seen indicator if count is zero

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-05-23 12:34:56 -07:00
parent be981d6f48
commit fdf04f6229

View file

@ -269,9 +269,9 @@
var oldestUnread = this.model.messageCollection.find(function(model) { var oldestUnread = this.model.messageCollection.find(function(model) {
return model.get('unread'); return model.get('unread');
}); });
var unreadCount = this.model.get('unreadCount');
if (oldestUnread) { if (oldestUnread && unreadCount > 0) {
var unreadCount = this.model.get('unreadCount');
this.lastSeenIndicator = new Whisper.LastSeenIndicatorView({count: unreadCount}); this.lastSeenIndicator = new Whisper.LastSeenIndicatorView({count: unreadCount});
var unreadEl = this.lastSeenIndicator.render().$el; var unreadEl = this.lastSeenIndicator.render().$el;