show page 1 even if there is nothing to page
This commit is contained in:
@ -72,7 +72,7 @@ app:get("thread", "/:slug", function(self)
|
||||
local post_count = Posts:count(db.clause({
|
||||
thread_id = thread.id
|
||||
}))
|
||||
self.pages = math.ceil(post_count / POSTS_PER_PAGE)
|
||||
self.pages = math.max(math.ceil(post_count / POSTS_PER_PAGE), 1)
|
||||
|
||||
if self.params.after then
|
||||
local after_id = tonumber(self.params.after)
|
||||
|
Reference in New Issue
Block a user