jenkins-bot has submitted this change and it was merged.

Change subject: Add method to get local unread notifications in the manager
......................................................................


Add method to get local unread notifications in the manager

Bug: T141404
Change-Id: I90aa4b83cdc1f3c1c793f8ca88b532a428c7b0af
---
M modules/model/mw.echo.dm.ModelManager.js
1 file changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/model/mw.echo.dm.ModelManager.js 
b/modules/model/mw.echo.dm.ModelManager.js
index cc7ecb1..706413d 100644
--- a/modules/model/mw.echo.dm.ModelManager.js
+++ b/modules/model/mw.echo.dm.ModelManager.js
@@ -288,6 +288,18 @@
        };
 
        /**
+        * 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.
         *

-- 
To view, visit https://gerrit.wikimedia.org/r/308815
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I90aa4b83cdc1f3c1c793f8ca88b532a428c7b0af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <mor...@gmail.com>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to