From 717955a513ac8c161b62618731406485563b8f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 17 Feb 2021 13:30:03 +0100 Subject: [PATCH] Make new topic autosave specific to page title Bug: T274949 Change-Id: I7e1bbcd6c606c7443f55fe3b1780021b07b28c5e --- modules/NewTopicController.js | 2 +- modules/controller.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/NewTopicController.js b/modules/NewTopicController.js index 11e8947ae..6b508f4a8 100644 --- a/modules/NewTopicController.js +++ b/modules/NewTopicController.js @@ -33,7 +33,7 @@ function NewTopicController( $pageContainer, $replyLink ) { endContainer: this.sectionTitleField.$element[ 0 ], endOffset: this.sectionTitleField.$element[ 0 ].childNodes.length } ); - comment.id = 'new'; + comment.id = 'new|' + mw.config.get( 'wgRelevantPageName' ); comment.isNewTopic = true; NewTopicController.super.call( this, $pageContainer, $replyLink, comment ); diff --git a/modules/controller.js b/modules/controller.js index 4516f5a31..c4d73760d 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -331,7 +331,7 @@ function init( $container, state ) { // For debugging (now unused in the code) mw.dt.pageThreads = pageThreads; - if ( state.repliedTo === 'new' ) { + if ( state.repliedTo === 'new|' + mw.config.get( 'wgRelevantPageName' ) ) { // Highlight the last comment on the page lastComment = threadItems[ threadItems.length - 1 ]; highlight( lastComment );