Skip to content

Commit

Permalink
Make last seen indicator more stable, with less forced removal
Browse files Browse the repository at this point in the history
FREEBIE
  • Loading branch information
scottnonnenberg committed May 27, 2017
1 parent c3dc973 commit 09791ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/views/conversation_view.js
Expand Up @@ -278,14 +278,14 @@
options = options || {};
_.defaults(options, {scroll: true});

this.removeLastSeenIndicator({force: true});

var oldestUnread = this.model.messageCollection.find(function(model) {
return model.get('unread');
});
var unreadCount = this.model.get('unreadCount');

if (oldestUnread && unreadCount > 0) {
this.removeLastSeenIndicator({force: true});

this.lastSeenIndicator = new Whisper.LastSeenIndicatorView({count: unreadCount});
var unreadEl = this.lastSeenIndicator.render().$el;

Expand All @@ -303,6 +303,9 @@
}
}.bind(this), 1);
}
else {
this.removeLastSeenIndicator({force: false});
}
},

focusMessageField: function() {
Expand Down

0 comments on commit 09791ab

Please sign in to comment.