mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
closes #1597
turns out clicking back causes double script.init() calls and
ajaxify.variables.get('topic_id') can be undefined in one of those
calls.
This commit is contained in:
@@ -376,7 +376,8 @@ define(['forum/pagination', 'forum/infinitescroll', 'forum/topic/threadTools', '
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadPostsAfter(after, callback) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,7 +387,7 @@ define(['forum/pagination', 'forum/infinitescroll', 'forum/topic/threadTools', '
|
|||||||
}
|
}
|
||||||
|
|
||||||
infinitescroll.loadMore('topics.loadMore', {
|
infinitescroll.loadMore('topics.loadMore', {
|
||||||
tid: ajaxify.variables.get('topic_id'),
|
tid: tid,
|
||||||
after: after
|
after: after
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user