Skip to content
This repository was archived by the owner on Jun 15, 2019. It is now read-only.

Commit e17d25b

Browse files
committed
General checks and fixes.
1 parent 7226a9e commit e17d25b

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

extension/data/modules/comment.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff 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(){

extension/data/modules/historybutton.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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
})();

extension/data/tbutils.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)