session-desktop/js/views/last_seen_indicator_view.js
lilia 017bb56cca 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
2017-05-23 11:08:23 -07:00

25 lines
671 B
JavaScript

/*
* vim: ts=4:sw=4:expandtab
*/
(function () {
'use strict';
window.Whisper = window.Whisper || {};
Whisper.LastSeenIndicatorView = Whisper.View.extend({
className: 'last-seen-indicator-view',
templateName: 'last-seen-indicator-view',
initialize: function(options) {
options = options || {};
this.count = options.count || 0;
},
render_attributes: function() {
var unreadMessages = this.count === 1 ? i18n('unreadMessage')
: i18n('unreadMessages', [this.count]);
return {
unreadMessages: unreadMessages
};
}
});
})();