mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 15:06:38 +02:00
removed another unnecessary socket call
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user