v1.18.x
Baris Soner Usakli 12 years ago
parent f7f5da00e1
commit 4527b3d53c

@ -188,8 +188,10 @@ var RDB = require('./redis.js'),
else
--topicCountToLoad;
if(retrieved_topics.length === topicCountToLoad)
if(retrieved_topics.length === topicCountToLoad) {
console.log('derp');
callback(retrieved_topics);
}
});
});
}

@ -293,14 +293,19 @@ marked.setOptions({
while(numPosts--) {
if(posts[numPosts].deleted !== '1') {
callback(posts[numPosts].pid);
break;
return;
}
}
if(posts.length > 0)
callback(posts[0].pid);
else
callback(null);
});
}
Topics.getTeaser = function(tid, callback) {
Topics.get_latest_undeleted_pid(tid, function(pid) {
console.log(pid);
if (pid !== null) {
posts.getPostFields(pid, ['content', 'uid', 'timestamp'], function(postData) {
@ -320,6 +325,13 @@ marked.setOptions({
});
});
});
} else {
callback({
"text": "",
"username": "",
"picture": "",
"timestamp" : ""
});
}
});
}

Loading…
Cancel
Save