Skip to content

Node.js based forum software built for the modern web

closes #1597

barisusakli652e1ef5745b
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 4337937a99..532526763e 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -376,7 +376,8 @@ define(['forum/pagination', 'forum/infinitescroll', 'forum/topic/threadTools', '
}
function loadPostsAfter(after, callback) {
- if (!utils.isNumber(after) || (after === 0 && $('#post-container li.post-row[data-index="0"]').length)) {
+ var tid = ajaxify.variables.get('topic_id');
+ if (!utils.isNumber(tid) || !utils.isNumber(after) || (after === 0 && $('#post-container li.post-row[data-index="0"]').length)) {
return;
}
@@ -386,7 +387,7 @@ define(['forum/pagination', 'forum/infinitescroll', 'forum/topic/threadTools', '
}
infinitescroll.loadMore('topics.loadMore', {
- tid: ajaxify.variables.get('topic_id'),
+ tid: tid,
after: after
}, function (data) {