Skip to content

Commit

Permalink
Merge pull request #414 from MikiEremiki/develop
Browse files Browse the repository at this point in the history
Fix List when current page is bigger than pages count
  • Loading branch information
Tishka17 authored Jul 19, 2024
2 parents 1e8acff + 39a7bed commit a37ae78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/aiogram_dialog/widgets/text/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ async def _render_text(
current_page = 0
start = 0
else:
current_page = await self.get_page(manager)
last_page = pages - 1
current_page = min(last_page, await self.get_page(manager))
start = current_page * self.page_size
items = items[start:start + self.page_size]

Expand Down

0 comments on commit a37ae78

Please sign in to comment.