enabling infinite post loader (re: issue #42), fixes #42

This commit is contained in:
Julian Lam
2013-06-26 13:38:05 -04:00
parent 9df0b39a5d
commit 936a284397
3 changed files with 40 additions and 20 deletions

View File

@@ -410,11 +410,13 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
end = start + 10;
posts.getPostsByTid(data.tid, uid, start, end, function(posts){
postTools.constructPostObject(posts, data.tid, uid, null, function(postObj) {
io.sockets.in('topic_' + data.tid).emit('event:new_post', {
posts: postObj
if (!posts.error) {
postTools.constructPostObject(posts, data.tid, uid, null, function(postObj) {
io.sockets.in('topic_' + data.tid).emit('event:new_post', {
posts: postObj
});
});
});
}
});
});