fix: getSortedTopics; filter out topics in cid -1 unless explicitly asked for

This commit is contained in:
Julian Lam
2024-03-26 13:09:47 -04:00
parent 0e2daa58aa
commit dff5d1c6cd

View File

@@ -257,6 +257,7 @@ module.exports = function (Topics) {
t &&
t.cid &&
!isCidIgnored[t.cid] &&
(cids || parseInt(t.cid, 10) !== -1) &&
(!cids || cids.includes(String(t.cid))) &&
(!tags.length || tags.every(tag => t.tags.find(topicTag => topicTag.value === tag)))
)).map(t => t.tid);