fix: only add to set if numRecentReplies>0

This commit is contained in:
Barış Soner Uşaklı
2020-05-05 14:12:46 -04:00
parent b25b51bd97
commit 16a98eaf50

View File

@@ -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 });
};