Bound the page number in the reader route

fixes #104
This commit is contained in:
Alex Ling 2020-09-17 16:06:01 +00:00
parent a5b6fb781f
commit 2a04f4531e

View File

@ -12,7 +12,7 @@ class ReaderRouter < Router
next layout "reader-error" if entry.err_msg
# load progress
page = entry.load_progress username
page = [1, entry.load_progress username].max
# start from page 1 if the user has finished reading the entry
page = 1 if entry.finished? username