Skip to content

Commit 686f9d6

Browse files
Improvements on double page (#417)
* going to next chapter and prev page works now * cleaned comments * updated mapping file * changed version back * Fixed chapters being read. * fixed comments
1 parent 6afd12b commit 686f9d6

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/components/reader/pager/DoublePagedPager.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ const isSinglePage = (index: number, spreadPages: boolean[]): boolean => {
2323
if (spreadPages[index]) return true;
2424
// Page is single if it is last page
2525
if (index === spreadPages.length - 1) return true;
26-
// Page can not be single if it is not followed by spread
27-
if (!spreadPages[index + 1]) return false;
2826
// Page is single if number of single pages since last spread is odd
2927
const previousSpreadIndex = spreadPages.lastIndexOf(true, index - 1);
3028
const numberOfNonSpreads = index - (previousSpreadIndex + 1);
@@ -86,12 +84,7 @@ export default function DoublePagedPager(props: IReaderProps) {
8684

8785
function pagesToGoBack() {
8886
// If previous page is single page, go only one page pack
89-
// If previous page is not single page, but we are on last page
90-
// go back one page anyway.
91-
// This handles special case, where last page was displayed in pair, but then
92-
// page was changed to the last page and now it is shown as single page.
93-
const isLastPage = curPage === spreadPage.current.length - 1;
94-
if (isSinglePage(curPage - 1, spreadPage.current) || isLastPage) {
87+
if (isSinglePage(curPage - 1, spreadPage.current)) {
9588
return 1;
9689
}
9790

0 commit comments

Comments
 (0)