Merge "Use core behaviour regarding saving options for non-registered users"

This commit is contained in:
jenkins-bot 2023-03-27 14:25:51 +00:00 committed by Gerrit Code Review
commit fe024e6813

View file

@ -299,11 +299,6 @@
context.fn.updateButtonIcon( 'lineWrapping', context.fn.isLineWrappingActive ); context.fn.updateButtonIcon( 'lineWrapping', context.fn.isLineWrappingActive );
}, },
setCodeEditorPreference: function ( prefValue ) { setCodeEditorPreference: function ( prefValue ) {
// Do not try to save options for anonymous user
if ( mw.user.isAnon() ) {
return;
}
// Abort any previous request // Abort any previous request
api.abort(); api.abort();
@ -313,6 +308,10 @@
// Request was aborted. Ignore error // Request was aborted. Ignore error
return; return;
} }
if ( code === 'notloggedin' ) {
// Expected for non-registered users
return;
}
var message = 'Failed to set code editor preference: ' + code; var message = 'Failed to set code editor preference: ' + code;
if ( result.error && result.error.info ) { if ( result.error && result.error.info ) {