mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
check to see if there are topics
This commit is contained in:
@@ -76,13 +76,16 @@ module.exports = function(Topics) {
|
||||
topics: []
|
||||
};
|
||||
|
||||
function sendUnreadTopics(topicIds) {
|
||||
|
||||
Topics.getTopicsByTids(topicIds, uid, function(err, topicData) {
|
||||
if(err) {
|
||||
function sendUnreadTopics(tids) {
|
||||
Topics.getTopicsByTids(tids, uid, function(err, topicData) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (!Array.isArray(topicData) || !topicData.length) {
|
||||
return callback(null, unreadTopics);
|
||||
}
|
||||
|
||||
db.sortedSetRevRank('topics:recent', topicData[topicData.length - 1].tid, function(err, rank) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
|
||||
Reference in New Issue
Block a user