|
|
@ -46,6 +46,9 @@
|
|
|
|
countUnread: function() {
|
|
|
|
countUnread: function() {
|
|
|
|
return this.getUnread().then(function(unreadMessages) {
|
|
|
|
return this.getUnread().then(function(unreadMessages) {
|
|
|
|
this.save({unreadCount: unreadMessages.length});
|
|
|
|
this.save({unreadCount: unreadMessages.length});
|
|
|
|
|
|
|
|
if (unreadMessages.length) {
|
|
|
|
|
|
|
|
console.log(this.id, 'unread messages:', unreadMessages.pluck('sent_at'));
|
|
|
|
|
|
|
|
}
|
|
|
|
}.bind(this));
|
|
|
|
}.bind(this));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|