Start from page 1 if the entry has been completed

(#71)
This commit is contained in:
Alex Ling
2020-06-16 06:15:58 +00:00
parent ca8d9efcfd
commit 00fcc881ee
2 changed files with 6 additions and 3 deletions

View File

@@ -15,6 +15,9 @@ class ReaderRouter < Router
# might not have actually read them
page = [page - 2 * IMGS_PER_PAGE, 1].max
# start from page 1 if the user has finished reading the entry
page = 1 if entry.finished? username
redirect env, "/reader/#{title.id}/#{entry.id}/#{page}"
rescue e
@context.error e