Initialize Echo when CentralAuth autologin replaces the user toolbar

Bug: T55134
Change-Id: I2699e84080c907c491b1becdc485fd176f3b2bca
This commit is contained in:
Gergő Tisza 2022-11-19 23:17:50 -08:00
parent b21fc3bf28
commit b69a2cf57f
No known key found for this signature in database
GPG key ID: C34FEC97E6257F96
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'
] );
} );