Skip to content

Commit

Permalink
fix console error
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Oct 22, 2024
1 parent 14194cd commit e9ac0b9
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions UserRightsDiff/UserRightsDiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class UserRightsDiff {
this.onDomNodeInserted( 'mw-logevent-loglines', this.checkLog, this );

// Special:UserRights, Special:Log, Special:Watchlist
this.checkLog();
this.checkLog( this );
}

onDomNodeInserted( htmlClassString, fn, that ) {
Expand All @@ -46,9 +46,6 @@ class UserRightsDiff {
}

checkLog( that ) {
// turn listener off (prevent infinite loop)
that.$( 'body' ).off( 'DOMNodeInserted' );

// don't run twice on the same page
if ( that.$( '.user-rights-diff' ).length === 0 ) {
// Special:UserRights, Special:Log, BradV SuperLinks
Expand All @@ -60,11 +57,6 @@ class UserRightsDiff {
that.checkLine( this );
} );
}

// turn listener back on
that.$( 'body' ).on( 'DOMNodeInserted', '.mw-logevent-loglines', () => {
that.checkLog();
} );
}

checkLine( el ) {
Expand Down

0 comments on commit e9ac0b9

Please sign in to comment.