Bsitu has uploaded a new change for review. https://gerrit.wikimedia.org/r/150394
Change subject: Only trigger 'mark as read' API if unread notification is not 0 ...................................................................... Only trigger 'mark as read' API if unread notification is not 0 Change-Id: I4fac7a9a8b7675fa9ffbe91b1306036fc3376eac --- M javascripts/modules/notifications/NotificationsOverlay.js 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/94/150394/1 diff --git a/javascripts/modules/notifications/NotificationsOverlay.js b/javascripts/modules/notifications/NotificationsOverlay.js index 8d19a98..8306da0 100644 --- a/javascripts/modules/notifications/NotificationsOverlay.js +++ b/javascripts/modules/notifications/NotificationsOverlay.js @@ -67,8 +67,13 @@ // Set up event logging for each notification mw.echo.setupNotificationLogging( $notification, 'mobile-overlay', true ); } ); - - self.markAllAsRead(); + // Only fire 'mark as read' API call when unread notification + // count is not zero. Question: why does this fire an API call + // for 'mark all as read', the overlay may not load all unread + // notifications + if ( result.query.notifications.rawcount !== 0 ) { + self.markAllAsRead(); + } } else { self.onError(); } -- To view, visit https://gerrit.wikimedia.org/r/150394 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4fac7a9a8b7675fa9ffbe91b1306036fc3376eac Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Bsitu <bs...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits