Skip to content

Node.js based forum software built for the modern web

fix: if reputation is disabled hide votes on /recent

Barış Soner Uşaklı8a786c717e53
diff --git a/install/package.json b/install/package.json
index 9e94fa1ed3..55dee022a8 100644
--- a/install/package.json
+++ b/install/package.json
@@ -106,10 +106,10 @@
"nodebb-plugin-spam-be-gone": "2.3.2",
"nodebb-plugin-web-push": "0.7.5",
"nodebb-rewards-essentials": "1.0.2",
- "nodebb-theme-harmony": "2.1.18",
+ "nodebb-theme-harmony": "2.1.19",
"nodebb-theme-lavender": "7.1.19",
"nodebb-theme-peace": "2.2.48",
- "nodebb-theme-persona": "14.1.12",
+ "nodebb-theme-persona": "14.1.13",
"nodebb-widget-essentials": "7.0.40",
"nodemailer": "7.0.6",
"nprogress": "0.2.0",
diff --git a/public/src/modules/topicList.js b/public/src/modules/topicList.js
index 6396bb9e8e..bc5a6e4abd 100644
--- a/public/src/modules/topicList.js
+++ b/public/src/modules/topicList.js
@@ -53,7 +53,7 @@ define('topicList', [
handleBack.init(function (after, handleBackCallback) {
loadTopicsCallback(after, 1, function (data, loadCallback) {
- onTopicsLoaded(templateName, data.topics, ajaxify.data.showSelect, 1, function () {
+ onTopicsLoaded(templateName, data, ajaxify.data.showSelect, 1, function () {
handleBackCallback();
loadCallback();
});
@@ -166,7 +166,7 @@ define('topicList', [
}
loadTopicsCallback(after, direction, function (data, done) {
- onTopicsLoaded(templateName, data.topics, ajaxify.data.showSelect, direction, done);
+ onTopicsLoaded(templateName, data, ajaxify.data.showSelect, direction, done);
});
};
@@ -187,7 +187,8 @@ define('topicList', [
});
}
- function onTopicsLoaded(templateName, topics, showSelect, direction, callback) {
+ function onTopicsLoaded(templateName, data, showSelect, direction, callback) {
+ let { topics } = data;
if (!topics || !topics.length) {
$('#load-more-btn').hide();
return callback();
@@ -212,6 +213,7 @@ define('topicList', [
const tplData = {
topics: topics,
showSelect: showSelect,
+ 'reputation:disabled': data['reputation:disabled'],
template: {
name: templateName,
},
diff --git a/src/controllers/recent.js b/src/controllers/recent.js
index 5699fee1b7..656958463b 100644
--- a/src/controllers/recent.js
+++ b/src/controllers/recent.js
@@ -79,6 +79,7 @@ recentController.getData = async function (req, url, sort) {
data.selectedTag = tagData.selectedTag;
data.selectedTags = tagData.selectedTags;
data['feeds:disableRSS'] = meta.config['feeds:disableRSS'] || 0;
+ data['reputation:disabled'] = meta.config['reputation:disabled'];
if (!meta.config['feeds:disableRSS']) {
data.rssFeedUrl = `${relative_path}/${url}.rss`;
if (req.loggedIn) {