mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
Merge "Add method to get local unread notifications in the manager"
This commit is contained in:
commit
4a680a1e78
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue