Skip to content

Node.js based forum software built for the modern web

fix: only add to set if numRecentReplies>0

Barış Soner Uşaklı16a98eaf50c7
diff --git a/src/categories/recentreplies.js b/src/categories/recentreplies.js
index 178b32110f..4ae423f6ac 100644
--- a/src/categories/recentreplies.js
+++ b/src/categories/recentreplies.js
@@ -33,8 +33,9 @@ module.exports = function (Categories) {
await db.sortedSetsRemoveRangeByScore(['cid:' + cid + ':recent_tids'], '-inf', data[data.length - 1].score);
}
}
-
- await db.sortedSetAdd('cid:' + cid + ':recent_tids', Date.now(), tid);
+ if (numRecentReplies > 0) {
+ await db.sortedSetAdd('cid:' + cid + ':recent_tids', Date.now(), tid);
+ }
await plugins.fireHook('action:categories.updateRecentTid', { cid: cid, tid: tid });
};