mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-03 14:20:33 +01:00
fix new topics showing up in all categories on post
This commit is contained in:
@@ -180,6 +180,11 @@ define('forum/category', ['composer', 'forum/pagination', 'forum/infinitescroll'
|
||||
}
|
||||
|
||||
Category.onNewTopic = function(topic) {
|
||||
var cid = ajaxify.variables.get('category_id');
|
||||
if(!topic || parseInt(topic.cid, 10) !== parseInt(cid, 10)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(window).trigger('filter:categories.new_topic', topic);
|
||||
|
||||
templates.parse('category', 'topics', {
|
||||
|
||||
@@ -143,7 +143,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
||||
|
||||
function onNewPost(data) {
|
||||
var tid = ajaxify.variables.get('topic_id');
|
||||
if(data && data.posts && data.posts.length && data.posts[0].tid !== tid) {
|
||||
if(data && data.posts && data.posts.length && parseInt(data.posts[0].tid, 10) !== parseInt(tid, 10)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user