ChapterBug // Fix jump to wrong page if chapter number if (number - 1) % pagelength = 0 (#3730)

This commit is contained in:
yoshnopa 2023-05-16 02:26:35 +02:00 committed by GitHub
parent 0069c48e7e
commit 0e199a525f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -466,7 +466,7 @@ export const LightboxComponent: React.FC<IProps> = ({
function gotoPage(imageIndex: number) {
const indexInPage = (imageIndex - 1) % pageSize;
if (pageCallback) {
let jumppage = Math.floor(imageIndex / pageSize) + 1;
let jumppage = Math.floor((imageIndex - 1) / pageSize) + 1;
if (page !== jumppage) {
pageCallback({ page: jumppage });
oldImages.current = images;