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
This commit is contained in:
Ben Houghton 2019-12-03 17:00:16 +00:00
parent 0704644ee0
commit aeafb09d80

View file

@ -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 ) );
};
/**