show page 1 even if there is nothing to page
This commit is contained in:
@ -73,7 +73,7 @@ app:get("topic", "/:slug", function(self)
|
||||
}))
|
||||
self.topic = topic
|
||||
|
||||
self.pages = math.ceil(threads_count / THREADS_PER_PAGE)
|
||||
self.pages = math.max(math.ceil(threads_count / THREADS_PER_PAGE), 1)
|
||||
self.page = math.max(1, math.min(tonumber(self.params.page) or 1, self.pages))
|
||||
-- self.threads_list = db.query("SELECT * FROM threads WHERE topic_id = ? ORDER BY is_stickied DESC, created_at DESC", topic.id)
|
||||
self.threads_list = db.query([[
|
||||
|
Reference in New Issue
Block a user