EditCheck: Close any existing edit check dialog before opening onBeforeSave list

Depends-On: Ib58b05fab39bcdc7d68b84ae235cfff775d7712c
Change-Id: I04e6b209935756d6e56d479ec09f341463622acb
This commit is contained in:
Ed Sanders 2024-12-12 14:12:03 +00:00
parent e9c7503c72
commit 414e5d29ed

View file

@ -156,10 +156,12 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable
}
saveProcess.next( () => {
const windowAction = ve.ui.actionFactory.create( 'window', surface, 'check' );
// .always is not chainable
return windowAction.close( 'editCheckDialog' ).closed.then( () => {}, () => {} ).then( () => {
toolbar.toggle( false );
target.onContainerScroll();
// surface.executeCommand( 'editCheckDialogBeforeSave' );
const windowAction = ve.ui.actionFactory.create( 'window', surface, 'check' );
return windowAction.open( 'editCheckDialog', { listener: 'onBeforeSave', reviewMode: true } )
.then( ( instance ) => instance.closing )
.then( ( data ) => {
@ -193,6 +195,7 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable
}
} );
} );
} );
} else {
// Counterpart to earlier preSaveChecksShown, for use in tracking
// errors in check-generation: