mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
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:
@@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,11 +13,6 @@
|
||||
this.count = options.count || 0;
|
||||
},
|
||||
|
||||
increment: function(count) {
|
||||
this.count += count;
|
||||
this.render();
|
||||
},
|
||||
|
||||
render_attributes: function() {
|
||||
var unreadMessages = this.count === 1 ? i18n('unreadMessage')
|
||||
: i18n('unreadMessages', [this.count]);
|
||||
|
||||
Reference in New Issue
Block a user