Skip user setting for unnamed users

Bug: T326908
Change-Id: I6421ad020db98d258c45d1f50d211d38b5c6f3a9
This commit is contained in:
WMDE-Fisch 2023-05-20 15:40:43 +03:00
parent 8fe657e90e
commit 7b385ee3ef

View file

@ -59,7 +59,7 @@ $.extend( Settings.prototype, {
*/
loadSetting: function ( name, defaultValue ) {
var setting;
if ( !mw.user.isAnon() ) {
if ( mw.user.isNamed() ) {
setting = mw.user.options.get( 'userjs-revslider-' + name );
} else {
setting = mw.storage.get( 'mw-revslider-' + name );
@ -85,7 +85,7 @@ $.extend( Settings.prototype, {
* @param {string} value
*/
saveSetting: function ( name, value ) {
if ( !mw.user.isAnon() ) {
if ( mw.user.isNamed() ) {
( new mw.Api() ).saveOption( 'userjs-revslider-' + name, value );
} else {
if ( !mw.storage.set( 'mw-revslider-' + name, value ) ) {