mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 08:23:52 +00:00
Merge "Clear pageDataCache
whenever re-initializing"
This commit is contained in:
commit
e27e5ac55e
|
@ -242,6 +242,11 @@ function init( $container, state ) {
|
|||
CommentController = require( './CommentController.js' ),
|
||||
NewTopicController = require( './NewTopicController.js' );
|
||||
|
||||
// We may be re-initializing after posting a new comment, so clear the cache, because
|
||||
// wgCurRevisionId will not change if we posted to a transcluded page (T266275).
|
||||
// This also applies when another tool has posted a comment and reloaded page contents (T323661).
|
||||
pageDataCache = {};
|
||||
|
||||
// Lazy-load postEdit module, may be required later (on desktop)
|
||||
mw.loader.using( 'mediawiki.action.view.postEdit' );
|
||||
|
||||
|
@ -561,10 +566,6 @@ function update( data, threadItem, pageName, replyWidget ) {
|
|||
} );
|
||||
}
|
||||
|
||||
// We posted a new comment, clear the cache, because wgCurRevisionId will not change if we posted
|
||||
// to a transcluded page (T266275)
|
||||
pageDataCache[ mw.config.get( 'wgRelevantPageName' ) ][ mw.config.get( 'wgCurRevisionId' ) ] = null;
|
||||
|
||||
var pageExists = !!mw.config.get( 'wgRelevantArticleId' );
|
||||
if ( !pageExists ) {
|
||||
// The page didn't exist before this update, so reload it. We'd handle
|
||||
|
|
Loading…
Reference in a new issue