From: Timo Tijhof Date: Fri, 29 Mar 2019 18:36:48 +0000 (+0000) Subject: mediawiki.user: Use then() instead of done() X-Git-Tag: 1.34.0-rc.0~2224^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=2a4f6865a1adb90403198ff4a7d62612c3e91ce0;p=lhc%2Fweb%2Fwiklou.git mediawiki.user: Use then() instead of done() Makes it compatible with standard ES6 Promise, and also allows the browser to respond sooner to user input (if there was any) rather than (synchronously) continuing within this same async block. Change-Id: I82aac439cecd7680f53a82649196c9168eda6755 --- diff --git a/resources/src/mediawiki.user.js b/resources/src/mediawiki.user.js index d9b1227bbb..aada50c52a 100644 --- a/resources/src/mediawiki.user.js +++ b/resources/src/mediawiki.user.js @@ -173,7 +173,7 @@ var userGroups = mw.config.get( 'wgUserGroups', [] ); // Uses promise for backwards compatibility - return $.Deferred().resolve( userGroups ).done( callback ); + return $.Deferred().resolve( userGroups ).then( callback ); }, /** @@ -186,7 +186,7 @@ return getUserInfo().then( function ( userInfo ) { return userInfo.rights; }, function () { return []; } - ).done( callback ); + ).then( callback ); } } );