This repository was archived by the owner on Jun 15, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-3
lines changed
Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -719,8 +719,16 @@ self.init = function () {
719719 } ) ;
720720 }
721721 }
722-
723- commentSearch ( ) ;
722+ TBUtils . modSubCheck ( function ( result ) {
723+ if ( $body . hasClass ( 'profile-page' ) ) {
724+ if ( $body . find ( '#header-bottom-right .user a' ) . text ( ) === $body . find ( '#header-bottom-left .pagename' ) . text ( ) ) {
725+ result = true ;
726+ }
727+ }
728+ if ( result ) {
729+ commentSearch ( ) ;
730+ }
731+ } ) ;
724732
725733 var hidden = false ;
726734 function addHideModButton ( ) {
Original file line number Diff line number Diff line change @@ -780,6 +780,10 @@ TB.register_module(self);
780780
781781( function ( ) {
782782 window . addEventListener ( "TBModuleLoaded" , function ( ) {
783- historybutton ( ) ;
783+ TBUtils . modSubCheck ( function ( result ) {
784+ if ( result ) {
785+ historybutton ( ) ;
786+ }
787+ } ) ;
784788 } ) ;
785789} ) ( ) ;
Original file line number Diff line number Diff line change @@ -981,6 +981,23 @@ function initwrapper() {
981981 }
982982 } ;
983983
984+ TBUtils . modSubCheck = function ( callback ) {
985+ TBUtils . getModSubs ( function ( ) {
986+ const subCount = TBUtils . mySubsData . length ;
987+ let subscriberCount = 0 ;
988+ TBUtils . mySubsData . forEach ( function ( subreddit ) {
989+ subscriberCount += subreddit . subscribers ;
990+ } ) ;
991+ subscriberCount -= subCount ;
992+ if ( subscriberCount > 25 ) {
993+ return callback ( true ) ;
994+ } else {
995+ return callback ( false ) ;
996+ }
997+
998+ } ) ;
999+ } ;
1000+
9841001 TBUtils . modsSub = function ( subreddit ) {
9851002 return $ . inArray ( subreddit , TBUtils . mySubs ) > - 1 ;
9861003 } ;
You can’t perform that action at this time.
0 commit comments