Make last seen indicator more stable, with less forced removal
FREEBIE
This commit is contained in:
parent
c3dc9732ef
commit
09791ab7d9
1 changed files with 5 additions and 2 deletions
|
@ -278,14 +278,14 @@
|
||||||
options = options || {};
|
options = options || {};
|
||||||
_.defaults(options, {scroll: true});
|
_.defaults(options, {scroll: true});
|
||||||
|
|
||||||
this.removeLastSeenIndicator({force: true});
|
|
||||||
|
|
||||||
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');
|
var unreadCount = this.model.get('unreadCount');
|
||||||
|
|
||||||
if (oldestUnread && unreadCount > 0) {
|
if (oldestUnread && unreadCount > 0) {
|
||||||
|
this.removeLastSeenIndicator({force: true});
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
@ -303,6 +303,9 @@
|
||||||
}
|
}
|
||||||
}.bind(this), 1);
|
}.bind(this), 1);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.removeLastSeenIndicator({force: false});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
focusMessageField: function() {
|
focusMessageField: function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue