mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-24 15:33:59 +00:00
Skip user setting for unnamed users
Bug: T326908 Change-Id: I6421ad020db98d258c45d1f50d211d38b5c6f3a9
This commit is contained in:
parent
8fe657e90e
commit
7b385ee3ef
|
@ -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 ) ) {
|
||||
|
|
Loading…
Reference in a new issue