Fix post pagination has no next page

This commit is contained in:
DefectingCat
2022-10-21 17:06:35 +08:00
parent 36eaa6cbba
commit c3ce01f453
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ const BlogPage = ({
<Pagination
className="py-6 mt-4 px-7 lg:px-5"
hasPrev={!!prev}
hasNext={next === total}
hasNext={next <= total}
prevLink={prev === 1 ? '/blog' : `/blog/${prev}`}
nextLink={`/blog/${next}`}
current={next - 1}

View File

@ -29,7 +29,7 @@ const Blog = ({
<Pagination
className="py-6 mt-4 px-7 lg:px-5"
hasPrev={false}
hasNext={next === total}
hasNext={next <= total}
prevLink={''}
nextLink={`/blog/${next}`}
current={1}