mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-28 10:11:45 +00:00
Merge "Update watchlist status from API result"
This commit is contained in:
commit
7e069cdb00
|
@ -307,8 +307,6 @@ CommentController.prototype.save = function ( comment, pageName ) {
|
|||
}
|
||||
return $.Deferred().reject( code, responseData ).promise();
|
||||
} ).then( function ( responseData ) {
|
||||
// Pass through watchlist state.
|
||||
responseData.watchlist = data.watchlist;
|
||||
controller.update( responseData, comment, pageName, replyWidget );
|
||||
} );
|
||||
} );
|
||||
|
|
|
@ -276,14 +276,16 @@ function update( data, comment, pageName, replyWidget ) {
|
|||
} );
|
||||
}
|
||||
|
||||
// Update watch link to match 'watch checkbox' in save dialog.
|
||||
// User logged in if module loaded.
|
||||
if ( mw.loader.getState( 'mediawiki.page.watch.ajax' ) === 'ready' ) {
|
||||
watch = require( 'mediawiki.page.watch.ajax' );
|
||||
|
||||
watch.updateWatchLink(
|
||||
// eslint-disable-next-line no-jquery/no-global-selector
|
||||
$( '#ca-watch a, #ca-unwatch a' ),
|
||||
data.watchlist === 'watch' ? 'unwatch' : 'watch'
|
||||
data.watched ? 'unwatch' : 'watch',
|
||||
'idle',
|
||||
data.watchlistexpiry
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue