simpler check

v1.18.x
barisusakli 9 years ago
parent 75e2228989
commit 9fc80702b8

@ -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;
}

Loading…
Cancel
Save