ULS Frontend: Save preferences only for named users

Add a new method isNamed in ext.uls.common to use the isNamed
method if available else use the isAnon method as usual.

mw.user.isNamed was added in MW 1.40

Bug: T337780
Change-Id: I747c042a95e8edc793a2265a15ed6ba8ae9f1997
This commit is contained in:
Abijeet
2023-08-10 19:44:25 +05:30
committed by jenkins-bot
parent 2434939475
commit 88f0045b94
4 changed files with 24 additions and 13 deletions

View File

@@ -188,7 +188,7 @@
lang, i, language, $button, autonym;
// Don't let anonymous users change interface language
if ( !anonsAllowed && mw.user.isAnon() ) {
if ( !anonsAllowed && !mw.uls.isNamed() ) {
$loginCta = $( '<p>' )
.attr( 'id', 'uls-display-settings-anon-log-in-cta' );
autonym = $.uls.data.getAutonym( this.contentLanguage );