Fix some corner casese with last seen indicator

* Remove increment behavior
* Dismiss when new messages arrive but the window is focused
* Update the indicator when window becomes focused.

// FREEBIE
This commit is contained in:
lilia
2017-05-22 14:13:37 -07:00
committed by Scott Nonnenberg
parent bb468e7b01
commit 017bb56cca
3 changed files with 2 additions and 16 deletions

View File

@@ -116,7 +116,7 @@
var onFocus = function() {
if (this.$el.css('display') !== 'none') {
this.markRead();
this.updateUnread();
}
}.bind(this);
this.window.addEventListener('focus', onFocus);
@@ -324,11 +324,8 @@
this.model.messageCollection.add(message, {merge: true});
message.setToExpire();
if (this.lastSeenIndicator) {
this.lastSeenIndicator.increment(1);
}
if (!this.isHidden() && window.isFocused()) {
this.removeLastSeenIndicator();
this.markRead();
}
},