mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Fix showing temp user popup after page reload"
This commit is contained in:
commit
69c37c9863
|
@ -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' );
|
||||
|
|
|
@ -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 );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue