From 60b9a71f9b31a5bffca7d5c95cbac8fb004f738f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Fri, 16 Dec 2022 22:05:40 +0100 Subject: [PATCH] Fix post-edit notification after switching from old wikitext editor Follow-up to 37b81b5ba411829783b7a707caa15c4f2dc0ab0d. Change-Id: I2e61b265822d75cd409d57a4aec7abfbbd4d3fc4 --- .../init/targets/ve.init.mw.ArticleTarget.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js index eea84deb79..3aa39d6271 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js @@ -642,11 +642,16 @@ ve.init.mw.ArticleTarget.prototype.saveComplete = function ( data ) { if ( !this.pageExists || this.restoring || !this.isViewPage ) { // Teardown the target, ensuring auto-save data is cleared this.teardown().then( function () { - - var newUrlParams = !target.pageExists || target.restoring ? - ( data.newrevid === undefined ? {} : { venotify: target.restoring ? 'restored' : 'created' } ) : - {}; - + var newUrlParams = {}; + if ( data.newrevid !== undefined ) { + if ( target.restoring ) { + newUrlParams.venotify = 'restored'; + } else if ( !target.pageExists ) { + newUrlParams.venotify = 'created'; + } else { + newUrlParams.venotify = 'saved'; + } + } if ( data.isRedirect ) { newUrlParams.redirect = 'no'; }