From 0c91e1795c89cd46840b172c93dd47db4b38ca91 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Wed, 18 Sep 2024 10:26:50 -0500 Subject: [PATCH] Edit check: only count ChecksAvailable after the check for source-mode Change-Id: I96091963af56a40d94445d7b65eb5c35326d0403 --- editcheck/modules/init.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editcheck/modules/init.js b/editcheck/modules/init.js index 6d35b03b74..b1fcfd4096 100644 --- a/editcheck/modules/init.js +++ b/editcheck/modules/init.js @@ -153,7 +153,6 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable let saveProcessDeferred; mw.hook( 've.preSaveProcess' ).add( ( saveProcess, target ) => { - ve.track( 'counter.editcheck.preSaveChecksAvailable' ); const surface = target.getSurface(); if ( surface.getMode() !== 'visual' ) { @@ -164,6 +163,8 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable return; } + ve.track( 'counter.editcheck.preSaveChecksAvailable' ); + // clear rejection-reasons between runs of the save process, so only the last one counts mw.editcheck.rejections.length = 0;