Keep sending CAPTCHA info if an unrelated save error happens

Bug: T371041
Change-Id: I72c73b0e323c794578edb14efcc9cc06e46a194b
This commit is contained in:
Bartosz Dziewoński 2024-08-27 23:53:54 +02:00
parent 4ff5bf253d
commit f76e47a3ef

View file

@ -498,11 +498,11 @@ CommentController.prototype.onReplySubmit = function ( extraParams ) {
* @param {Object} data Error data
*/
CommentController.prototype.saveFail = function ( code, data ) {
this.replyWidget.clearCaptcha();
const captchaData = OO.getProp( data, 'discussiontoolsedit', 'edit', 'captcha' );
if ( captchaData ) {
code = 'captcha';
this.replyWidget.clearCaptcha();
this.replyWidget.setCaptcha( captchaData );
} else {
this.replyWidget.setSaveErrorMessage( code, data );