removed another unnecessary socket call

v1.18.x
barisusakli 11 years ago
parent a7736d1926
commit 74282ffeea

@ -24,16 +24,8 @@ define('forum/home', function() {
};
home.onNewPost = function(data) {
if (data && data.posts && data.posts.length) {
socket.emit('posts.getCategory', data.posts[0].pid, function(err, cid) {
if (err) {
return;
}
renderNewPost(cid, data.posts[0]);
});
if (data && data.posts && data.posts.length && data.posts[0].topic) {
renderNewPost(data.posts[0].topic.cid, data.posts[0]);
}
};

@ -215,7 +215,7 @@ module.exports = function(Topics) {
},
function(userInfo, next) {
postData.user = userInfo[0];
Topics.getTopicFields(tid, ['tid', 'title', 'slug'], next);
Topics.getTopicFields(tid, ['tid', 'title', 'slug', 'cid'], next);
},
function(topicData, next) {
topicData.title = validator.escape(topicData.title);

Loading…
Cancel
Save