Ensure veswitched is not set when we set wteswitched in the URI

veswitched and wteswitched together cannot result in any sane behaviour.

To reproduce:
* Open VE (while having multi-tab pref?), switch into WTE
* Make a change
* Switch into VE

Change-Id: I90e19169e3fab60ab876c8e4d349801309db262f
This commit is contained in:
Alex Monk 2016-04-05 01:25:33 +01:00
parent 1ad77ddf91
commit 373a19f1cc

View file

@ -567,11 +567,14 @@
.then( function ( opened ) { return opened; } ) .then( function ( opened ) { return opened; } )
.then( function ( closing ) { return closing; } ) .then( function ( closing ) { return closing; } )
.then( function ( data ) { .then( function ( data ) {
var oldUri;
if ( data && data.action === 'keep' ) { if ( data && data.action === 'keep' ) {
activatePageTarget( true ); activatePageTarget( true );
} else if ( data && data.action === 'discard' ) { } else if ( data && data.action === 'discard' ) {
setEditorPreference( 'visualeditor' ); setEditorPreference( 'visualeditor' );
location.href = veEditUri.clone().extend( { wteswitched: 1 } ); oldUri = veEditUri.clone();
delete oldUri.query.veswitched;
location.href = oldUri.extend( { wteswitched: 1 } );
} }
} ); } );
} ); } );