Skip to content

Commit

Permalink
fix magic scroll on next chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Robonau authored and Robonau committed Jul 30, 2024
1 parent 540c31c commit d114811
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,10 @@
$: lowestIntersect = document.querySelector(
visiblePages.reduce(
(a, c) => {
if (c.chapterIndex >= a.chapterIndex && c.pageIndex > a.pageIndex) {
if (
c.chapterIndex > a.chapterIndex ||
(c.chapterIndex === a.chapterIndex && c.pageIndex > a.pageIndex)
) {
return c;
}
return a;
Expand Down

0 comments on commit d114811

Please sign in to comment.