mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fix first post loading when pagination is enabled
This commit is contained in:
@@ -54,7 +54,7 @@ topicsController.get = function(req, res, next) {
|
||||
|
||||
var settings = results.settings;
|
||||
var postCount = parseInt(results.topic.postcount, 10);
|
||||
var pageCount = Math.ceil((postCount - 1) / settings.postsPerPage);
|
||||
var pageCount = Math.max(1, Math.ceil((postCount - 1) / settings.postsPerPage));
|
||||
|
||||
if (utils.isNumber(req.params.post_index)) {
|
||||
var url = '';
|
||||
|
||||
Reference in New Issue
Block a user