Skip to content

Node.js based forum software built for the modern web

suggested topics fix, if search doesn't return enough topics

Baris Usakli1bb6067e1900
diff --git a/src/topics/suggested.js b/src/topics/suggested.js
index 3e8cd0e0c0..e6c32a4327 100644
--- a/src/topics/suggested.js
+++ b/src/topics/suggested.js
@@ -93,7 +93,8 @@ module.exports = function (Topics) {
db.getSortedSetRevRange('cid:' + cid + ':tids:lastposttime', 0, 9, next);
},
function (tids, next) {
- next(null, tids.map(Number));
+ tids = tids.map(Number).filter(_tid => _tid !== tid);
+ next(null, _.shuffle(tids));
},
], callback);
}