Add comment and fine-tune last-seen indicator when not focused

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-06-01 15:37:32 -07:00
parent 672a517b73
commit 1775e97bcd
2 changed files with 9 additions and 2 deletions

View file

@ -382,7 +382,12 @@
if (!this.lastSeenIndicator) {
this.resetLastSeenIndicator({scroll: false});
} else if (this.view.atBottom() && this.model.get('unreadCount') === this.lastSeenIndicator.getCount()) {
this.lastSeenIndicator.el.scrollIntoView();
// The count check ensures that the last seen indicator is still in
// sync with the real number of unread, so we can scroll to it.
// We only do this if we're at the bottom, because that signals that
// the user is okay with us changing scroll around so they see the
// right unseen message first.
this.resetLastSeenIndicator({scroll: true});
}
}
else if (!this.isHidden() && window.isFocused()) {