From aeafb09d80caf7dbe631a0e6eca559dc53bfa8e3 Mon Sep 17 00:00:00 2001 From: Ben Houghton Date: Tue, 3 Dec 2019 17:00:16 +0000 Subject: [PATCH] Allow marking all as read from popout window Clicking 'mark all as read' would only mark the notifications you are viewing as read instead of all of them - now it will mark all of them as read. Bug: T156425 Change-Id: If46a85f91dfddd4ac158e5c3a4f942c9c3d9aac1 --- modules/controller/mw.echo.Controller.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/controller/mw.echo.Controller.js b/modules/controller/mw.echo.Controller.js index b5d86164c..9714f29ca 100644 --- a/modules/controller/mw.echo.Controller.js +++ b/modules/controller/mw.echo.Controller.js @@ -499,13 +499,11 @@ */ mw.echo.Controller.prototype.markLocalNotificationsRead = function () { var modelName, model, - itemIds = [], readState = this.manager.getFiltersModel().getReadState(), modelItems = {}; this.manager.getLocalNotifications().forEach( function ( notification ) { if ( !notification.isRead() ) { - itemIds = itemIds.concat( notification.getAllIds() ); notification.toggleRead( true ); modelName = notification.getModelName(); @@ -525,9 +523,8 @@ // Update pagination count this.manager.updateCurrentPageItemCount(); - this.manager.getUnreadCounter().estimateChange( -itemIds.length ); - this.manager.getLocalCounter().estimateChange( -itemIds.length ); - return this.api.markItemsRead( itemIds, 'local', true ).then( this.refreshUnreadCount.bind( this ) ); + this.manager.getLocalCounter().setCount( 0, false ); + return this.api.markAllRead( 'local', this.getTypeString() ).then( this.refreshUnreadCount.bind( this ) ); }; /**