Added the empty condition in the __get_page_sizes method of the Pagination utility.

This commit is contained in:
依瑪貓 2023-02-04 11:37:00 +08:00
parent 1a44f08b90
commit a7a432914d

View File

@ -241,6 +241,8 @@ class Pagination(t.Generic[T]):
:return: The available page sizes.
"""
if not self.is_paged:
return []
return [Link(str(x), self.__uri_size(x),
is_current=x == self.__page_size)
for x in self.AVAILABLE_PAGE_SIZES]