From 9fc80702b8f36da5a154573aa394090701c03291 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 29 Sep 2015 17:09:41 -0400 Subject: [PATCH] simpler check --- public/src/client/topic/posts.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js index 36df0b3d1f..f17e8cbab5 100644 --- a/public/src/client/topic/posts.js +++ b/public/src/client/topic/posts.js @@ -13,12 +13,11 @@ define('forum/topic/posts', [ var Posts = {}; Posts.onNewPost = function(data) { - var tid = ajaxify.data.tid; - if (data && data.posts && data.posts.length && parseInt(data.posts[0].tid, 10) !== parseInt(tid, 10)) { + if (!data || !data.posts || !data.posts.length) { return; } - if (!data || !data.posts || !data.posts.length) { + if (parseInt(data.posts[0].tid, 10) !== parseInt(ajaxify.data.tid, 10)) { return; }