1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 23:38:09 +00:00

core/ui: fix crash when trying to scroll with only one page

This commit is contained in:
matejcik 2019-04-18 15:03:24 +02:00
parent 8ee605484e
commit 1e7357db80

View File

@ -21,9 +21,9 @@ async def change_page(page, page_count):
else:
s = await swipe
if s == SWIPE_UP:
return page + 1 # scroll down
return min(page + 1, page_count - 1) # scroll down
elif s == SWIPE_DOWN:
return page - 1 # scroll up
return max(page - 1, 0) # scroll up
async def paginate(render_page, page_count, page=0, *args):