Merge "Add method to get local unread notifications in the manager"

This commit is contained in:
jenkins-bot 2016-09-06 21:28:50 +00:00 committed by Gerrit Code Review
commit 4a680a1e78

View file

@ -287,6 +287,18 @@
return this.getLocalNotifications().some( isUnread );
};
/**
* Get local unread notifications
*
* @return {mw.echo.dm.NotificationItem[]} Local unread notifications
*/
mw.echo.dm.ModelManager.prototype.getLocalUnread = function () {
var isUnread = function ( item ) {
return !item.isRead();
};
return this.getLocalNotifications().filter( isUnread );
};
/**
* Check whether there are talk notifications, and emit an event
* in case there aren't any left.