diff --git a/public/src/forum/home.js b/public/src/forum/home.js index 461b5a9c8f..c770aceb36 100644 --- a/public/src/forum/home.js +++ b/public/src/forum/home.js @@ -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]); } }; diff --git a/src/topics/create.js b/src/topics/create.js index 60c41880b1..2feb2ae787 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -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);