Simplify variable assignment.
This makes the code shorter and the message is generated only in the else path. Change-Id: I1367280b6c154fe77b8a2cfbcdb6333aecefab53
This commit is contained in:
@@ -87,10 +87,8 @@
|
|||||||
} ).done( function () {
|
} ).done( function () {
|
||||||
location.replace( currentUrlWithoutSetLang() );
|
location.replace( currentUrlWithoutSetLang() );
|
||||||
} ).fail( function ( code, result ) {
|
} ).fail( function ( code, result ) {
|
||||||
var apiErrorInfo = mw.msg( 'ext-uls-setlang-unknown-error' );
|
var apiErrorInfo = result.error && result.error.info ||
|
||||||
if ( result.error && result.error.info ) {
|
mw.msg( 'ext-uls-setlang-unknown-error' );
|
||||||
apiErrorInfo = result.error.info;
|
|
||||||
}
|
|
||||||
mw.notify(
|
mw.notify(
|
||||||
mw.msg( 'ext-uls-setlang-error', apiErrorInfo ),
|
mw.msg( 'ext-uls-setlang-error', apiErrorInfo ),
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user