Customize: Ensure changeset_uuid
param for autosave auto-draft gets stripped from location after previewing theme switch when not in branching mode.
Amends [41597]. See #39896. Fixes #42415. git-svn-id: https://develop.svn.wordpress.org/trunk@42114 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c7cb694732
commit
9976cd2b66
@ -8248,6 +8248,7 @@
|
|||||||
|
|
||||||
// Set up initial notifications.
|
// Set up initial notifications.
|
||||||
(function() {
|
(function() {
|
||||||
|
var removedQueryParams = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain the URL to restore the autosave.
|
* Obtain the URL to restore the autosave.
|
||||||
@ -8344,9 +8345,13 @@
|
|||||||
|
|
||||||
if ( api.settings.changeset.autosaved ) {
|
if ( api.settings.changeset.autosaved ) {
|
||||||
api.state( 'saved' ).set( false );
|
api.state( 'saved' ).set( false );
|
||||||
stripParamsFromLocation( [ 'customize_autosaved' ] ); // Remove param when restoring autosave revision.
|
removedQueryParams.push( 'customize_autosaved' );
|
||||||
} else if ( ! api.settings.changeset.branching && 'auto-draft' === api.settings.changeset.status ) {
|
}
|
||||||
stripParamsFromLocation( [ 'changeset_uuid' ] ); // Remove UUID when restoring autosave auto-draft.
|
if ( ! api.settings.changeset.branching && ( ! api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ) ) {
|
||||||
|
removedQueryParams.push( 'changeset_uuid' ); // Remove UUID when restoring autosave auto-draft.
|
||||||
|
}
|
||||||
|
if ( removedQueryParams.length > 0 ) {
|
||||||
|
stripParamsFromLocation( removedQueryParams );
|
||||||
}
|
}
|
||||||
if ( api.settings.changeset.latestAutoDraftUuid || api.settings.changeset.hasAutosaveRevision ) {
|
if ( api.settings.changeset.latestAutoDraftUuid || api.settings.changeset.hasAutosaveRevision ) {
|
||||||
addAutosaveRestoreNotification();
|
addAutosaveRestoreNotification();
|
||||||
|
Loading…
Reference in New Issue
Block a user