Remove allTalkRead listener for the messages popup

This fixes a bug where changing the read status of any notification
in the messages popup would remove the "You have new messages"
banner even though there are still unread talk page notifications
in the alerts popup.

Change-Id: Ic6b3d2c9fa764be2da8f9bd9b0d10311857f8509
This commit is contained in:
Roan Kattouw 2016-08-04 13:58:47 -07:00
parent adaccf56e4
commit 16d239c516

View file

@ -91,13 +91,6 @@
mw.echo.ui.messageWidget.badgeButton.debouncedUpdateThemeClasses(); mw.echo.ui.messageWidget.badgeButton.debouncedUpdateThemeClasses();
// Replace the link button with the ooui button // Replace the link button with the ooui button
$existingMessageLink.parent().replaceWith( mw.echo.ui.messageWidget.$element ); $existingMessageLink.parent().replaceWith( mw.echo.ui.messageWidget.$element );
messageModelManager.on( 'allTalkRead', function () {
// If there was a talk page notification, get rid of it
$( '#pt-mytalk a' )
.removeClass( 'mw-echo-alert' )
.text( mw.msg( 'mytalk' ) );
} );
} }
unreadAlertCounter = new mw.echo.dm.UnreadNotificationCounter( echoApi, 'alert', maxNotificationCount ); unreadAlertCounter = new mw.echo.dm.UnreadNotificationCounter( echoApi, 'alert', maxNotificationCount );
alertModelManager = new mw.echo.dm.ModelManager( unreadAlertCounter, { type: 'alert' } ); alertModelManager = new mw.echo.dm.ModelManager( unreadAlertCounter, { type: 'alert' } );