Mark notifications as automatically read only after the popup loads

We've corrected this behavior for updating seenTime but not for setting
the notifications as read if the widget is configured as
'markReadWhenSeen' which produced unexpected issues with updating alerts.

This is fixed in this commit.

Change-Id: I4d2420a81d2b8409749ad1621b2d56bdd14e8c6e
This commit is contained in:
Moriel Schottlender 2015-09-30 11:42:53 -07:00
parent d15615ea89
commit f6c9e68577

View file

@ -260,11 +260,6 @@
// Log impressions
mw.echo.logger.logNotificationImpressions( this.type, idArray, mw.echo.Logger.static.context.popup );
// // Mark notifications as 'read' if markReadWhenSeen is set to true
if ( widget.popup.isVisible() && widget.markReadWhenSeen ) {
return widget.notificationsModel.markAllRead();
}
} )
.then(
// Success
@ -329,6 +324,10 @@
if ( widget.popup.isVisible() ) {
// Update seen time
widget.notificationsModel.updateSeenTime();
// Mark notifications as 'read' if markReadWhenSeen is set to true
if ( widget.markReadWhenSeen ) {
widget.notificationsModel.markAllRead();
}
}
} );
this.hasRunFirstTime = true;