jenkins-bot has submitted this change and it was merged. Change subject: Warn users when leaving while a save is in progress ......................................................................
Warn users when leaving while a save is in progress Bug: T94567 Change-Id: I774c944bda0e61e7e74bf694e80a573ff6cb5942 --- M modules/translation/ext.cx.translation.progress.js 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: KartikMistry: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/translation/ext.cx.translation.progress.js b/modules/translation/ext.cx.translation.progress.js index 88701da..7fe2c07 100644 --- a/modules/translation/ext.cx.translation.progress.js +++ b/modules/translation/ext.cx.translation.progress.js @@ -157,9 +157,12 @@ if ( mw.config.get( 'wgContentTranslationDatabase' ) !== null ) { if ( mw.cx.dirty ) { mw.hook( 'mw.cx.translation.save' ).fire(); + // If we leave the page immediately the above save may not happen. + // So, stay or leave? + return mw.msg( 'cx-warning-unsaved-translation' ); + } else { + return; } - - return; } weights = getTranslationWeights( getSectionsWithContent() ); -- To view, visit https://gerrit.wikimedia.org/r/201689 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I774c944bda0e61e7e74bf694e80a573ff6cb5942 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com> Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il> Gerrit-Reviewer: KartikMistry <kartik.mis...@gmail.com> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits