mirror of https://github.com/stijndcl/didier
Fix page splitting for menus
parent
89b345c61b
commit
5f72701714
|
@ -169,7 +169,7 @@ class PageSource(ABC, Generic[T]):
|
||||||
|
|
||||||
def get_page_data(self, page: int) -> list[T]:
|
def get_page_data(self, page: int) -> list[T]:
|
||||||
"""Get the chunk of the dataset for page [page]"""
|
"""Get the chunk of the dataset for page [page]"""
|
||||||
return self.dataset[page : page + self.per_page]
|
return self.dataset[page * self.per_page : (page + 1) * self.per_page]
|
||||||
|
|
||||||
async def start(self, *, ephemeral: bool = False, timeout: Optional[int] = None) -> Menu:
|
async def start(self, *, ephemeral: bool = False, timeout: Optional[int] = None) -> Menu:
|
||||||
"""Shortcut to creating (and starting) a Menu with this source
|
"""Shortcut to creating (and starting) a Menu with this source
|
||||||
|
|
Loading…
Reference in New Issue