Cleanup previous/next page buttons (#134)

Use noteq to simplify code, add current page to previous/next page bar

Reviewed-on: https://codeberg.org/rimgo/rimgo/pulls/134
Reviewed-by: orangix <orangix@noreply.codeberg.org>
Co-authored-by: video-prize-ranch <cb.8a3w5@simplelogin.co>
Co-committed-by: video-prize-ranch <cb.8a3w5@simplelogin.co>
This commit is contained in:
video-prize-ranch
2023-08-30 17:24:54 +00:00
committed by video-prize-ranch
parent 0fea1e46a3
commit fc88bfbca5
6 changed files with 10 additions and 27 deletions

View File

@@ -36,11 +36,6 @@ func HandleTrending(c *fiber.Ctx) error {
sort = "popular"
}
displayPrevPage := true
if page == "1" {
displayPrevPage = false
}
results, err := ApiClient.FetchTrending(section, sort, page)
if err != nil {
return err
@@ -51,7 +46,6 @@ func HandleTrending(c *fiber.Ctx) error {
"section": section,
"sort": sort,
"page": pageNumber,
"displayPrev": displayPrevPage,
"nextPage": pageNumber + 1,
"prevPage": pageNumber - 1,
})