mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-14 18:15:19 +00:00
Avoid error if watchlist has been toggled before editing
onWatchToggle didn't cope with the case where there was already an event in the hook-queue when it was registered during setup Bug: T328955 Change-Id: Ic80f707e86ba3c9f88097cac8aec8c6b3cc32cee
This commit is contained in:
parent
8eb272c2be
commit
d8fd73d72a
|
@ -368,7 +368,7 @@ ve.init.mw.DesktopArticleTarget.prototype.onWatchToggle = function ( isWatched )
|
|||
if ( !this.active && !this.activating ) {
|
||||
return;
|
||||
}
|
||||
if ( this.checkboxesByName.wpWatchthis ) {
|
||||
if ( this.checkboxesByName && this.checkboxesByName.wpWatchthis ) {
|
||||
this.checkboxesByName.wpWatchthis.setSelected(
|
||||
!!mw.user.options.get( 'watchdefault' ) ||
|
||||
( !!mw.user.options.get( 'watchcreations' ) && !this.pageExists ) ||
|
||||
|
|
Loading…
Reference in a new issue