Merge "Synchronizer: Fix defaultName config"

This commit is contained in:
jenkins-bot 2019-06-02 15:43:16 +00:00 committed by Gerrit Code Review
commit 1ed01e0a05

View file

@ -60,6 +60,8 @@
modulePromise.done( function () {
var dummySurface, surfaceModel,
isNewAuthor = !ve.init.platform.sessionStorage.get( 've-collab-author' ),
username = mw.user.getName(),
progressDeferred = $.Deferred();
target = ve.init.mw.targetFactory.create( 'collab', title, conf.rebaserUrl, { importTitle: importTitle } );
@ -84,7 +86,7 @@
// TODO: server could communicate with MW (via oauth?) to know the
// current-user's name. Disable changing name if logged in?
// Communicate an I-am-a-valid-user flag to other clients?
defaultName: mw.user.isAnon() ? mw.user.getName() : undefined
defaultName: username
}
);
@ -103,6 +105,10 @@
target.once( 'surfaceReady', function () {
initPromise.then( function () {
surfaceModel.selectFirstContentOffset();
// For new anon users, open the author list so they can set their name
if ( isNewAuthor && !username ) {
target.actionsToolbar.tools.authorList.onSelect();
}
} );
} );