Merge "Fix showing temp user popup after page reload"

This commit is contained in:
jenkins-bot 2023-08-30 13:32:37 +00:00 committed by Gerrit Code Review
commit 69c37c9863
2 changed files with 13 additions and 10 deletions

View file

@ -648,6 +648,18 @@ ve.init.mw.ArticleTarget.prototype.saveComplete = function ( data ) {
if ( data.nocontent || data.tempusercreated ) {
// Teardown the target, ensuring auto-save data is cleared
this.teardown().then( function () {
if ( data.newrevid !== undefined ) {
var action;
if ( target.restoring ) {
action = 'restored';
} else if ( !target.pageExists ) {
action = 'created';
} else {
action = 'saved';
}
require( 'mediawiki.action.view.postEdit' ).fireHookOnPageReload( action, data.tempusercreated );
}
if ( data.tempusercreatedredirect ) {
location.href = data.tempusercreatedredirect;
} else {
@ -655,15 +667,6 @@ ve.init.mw.ArticleTarget.prototype.saveComplete = function ( data ) {
if ( data.newrevid !== undefined ) {
// For GrowthExperiments
newUrl.searchParams.set( 'venotify', 'saved' );
var action;
if ( target.restoring ) {
action = 'restored';
} else if ( !target.pageExists ) {
action = 'created';
} else {
action = 'saved';
}
require( 'mediawiki.action.view.postEdit' ).fireHookOnPageReload( action );
}
if ( data.isRedirect ) {
newUrl.searchParams.set( 'redirect', 'no' );

View file

@ -415,7 +415,7 @@ ve.init.mw.MobileArticleTarget.prototype.saveComplete = function ( data ) {
var fragment = this.getSectionHashFromPage().slice( 1 );
this.overlay.sectionId = fragment;
this.overlay.onSaveComplete( data.newrevid, data.tempusercreatedredirect );
this.overlay.onSaveComplete( data.newrevid, data.tempusercreatedredirect, data.tempusercreated );
};
/**