Pass Echo configuration to mobile

When Echo moved to packageFiles it broke the mobile
unread counter behaviour

Follow up to I03f9a3953aa97ead1a29c13a992a02404a6d0b68
which presumably happened when Minerva's Echo code was
in a different code repository.

Bug: T310358
Change-Id: Ife6705d69d248bcd4efde1a996dbcc0353c7f40d
This commit is contained in:
Jon Robson 2022-06-10 08:09:50 -07:00 committed by Jdlrobson
parent e515e47392
commit 6767e52d8c
2 changed files with 5 additions and 1 deletions

View file

@ -330,6 +330,10 @@
"packageFiles": [
"mobile/notifications.js",
"mobile/list.js",
{
"name": "mobile/config.json",
"callback": "MediaWiki\\Extension\\Notifications\\Hooks::getConfigVars"
},
"mobile/overlay.js",
"mobile/NotificationBadge.js",
"mobile/notificationsFilterOverlay.js"

View file

@ -23,7 +23,7 @@ var mobile = mw.mobileFrontend.require( 'mobile.startup' ),
*/
function notificationsList( echo, markAllReadButton, onCountChange, onNotificationListRendered ) {
var wrapperWidget,
maxNotificationCount = mw.config.get( 'wgEchoMaxNotificationCount' ),
maxNotificationCount = require( './config.json' ).EchoMaxNotificationCount,
echoApi = new echo.api.EchoApi(),
unreadCounter = new echo.dm.UnreadNotificationCounter( echoApi, 'all', maxNotificationCount ),
modelManager = new echo.dm.ModelManager( unreadCounter, { type: [ 'message', 'alert' ] } ),