Merge "Initialize Echo when CentralAuth autologin replaces the user toolbar"

This commit is contained in:
jenkins-bot 2022-11-21 09:02:02 +00:00 committed by Gerrit Code Review
commit 35d89af670
3 changed files with 23 additions and 0 deletions

View file

@ -366,6 +366,15 @@
"mobile"
]
},
"ext.echo.centralauth": {
"packageFiles": [
"ext.echo.centralauth.js"
],
"targets": [
"desktop",
"mobile"
]
},
"ext.echo.styles.badge": {
"styles": [
"nojs/mw.echo.badge.less"

View file

@ -929,6 +929,9 @@ class Hooks implements
$user = $out->getUser();
if ( !$user->isRegistered() ) {
if ( ExtensionRegistry::getInstance()->isLoaded( 'CentralAuth' ) ) {
$out->addModules( [ 'ext.echo.centralauth' ] );
}
return;
}

View file

@ -0,0 +1,11 @@
/*
* Loads Echo on CentralAuth autologin
*/
mw.hook( 'centralauth-p-personal-reset' ).add( function () {
mw.loader.using( [
'ext.echo.init',
'ext.echo.styles.badge',
'oojs-ui.styles.icons-alerts',
'ext.echo.styles.alert'
] );
} );