popup is undefined

This will throw a client side error. Let's not do that. What's
needed here is a toast.

Change-Id: I6395fec5cf3fc6ac561aa13d3d9d031e153f3341
This commit is contained in:
jdlrobson 2019-02-08 12:31:03 -08:00
parent dc0efd360a
commit c90883c591

View file

@ -15,19 +15,16 @@
} ).then( function () {
mw.notify( mw.msg( 'thanks-thanked-notice', name, recipientGender, mw.user ) );
}, function ( errorCode ) {
// FIXME: What is "popup" and where is it defined?
/* eslint-disable no-undef */
switch ( errorCode ) {
case 'invalidrevision':
popup.show( mw.msg( 'thanks-error-invalidrevision' ) );
mw.notify( mw.msg( 'thanks-error-invalidrevision' ) );
break;
case 'ratelimited':
popup.show( mw.msg( 'thanks-error-ratelimited', recipientGender ) );
mw.notify( mw.msg( 'thanks-error-ratelimited', recipientGender ) );
break;
default:
popup.show( mw.msg( 'thanks-error-undefined', errorCode ) );
mw.notify( mw.msg( 'thanks-error-undefined', errorCode ) );
}
/* eslint-enable no-undef */
} );
}