Edit check: only count ChecksAvailable after the check for source-mode

Change-Id: I96091963af56a40d94445d7b65eb5c35326d0403
This commit is contained in:
David Lynch 2024-09-18 10:26:50 -05:00
parent a9c91ac78f
commit 0c91e1795c

View file

@ -153,7 +153,6 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable
let saveProcessDeferred; let saveProcessDeferred;
mw.hook( 've.preSaveProcess' ).add( ( saveProcess, target ) => { mw.hook( 've.preSaveProcess' ).add( ( saveProcess, target ) => {
ve.track( 'counter.editcheck.preSaveChecksAvailable' );
const surface = target.getSurface(); const surface = target.getSurface();
if ( surface.getMode() !== 'visual' ) { if ( surface.getMode() !== 'visual' ) {
@ -164,6 +163,8 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable
return; return;
} }
ve.track( 'counter.editcheck.preSaveChecksAvailable' );
// clear rejection-reasons between runs of the save process, so only the last one counts // clear rejection-reasons between runs of the save process, so only the last one counts
mw.editcheck.rejections.length = 0; mw.editcheck.rejections.length = 0;