check to see if there are topics

v1.18.x
barisusakli 11 years ago
parent 3493be4ef0
commit 038a833125

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

Loading…
Cancel
Save