From 0e199a525f3991b55f44e581cb28b80b35130703 Mon Sep 17 00:00:00 2001 From: yoshnopa <40072150+yoshnopa@users.noreply.github.com> Date: Tue, 16 May 2023 02:26:35 +0200 Subject: [PATCH] ChapterBug // Fix jump to wrong page if chapter number if (number - 1) % pagelength = 0 (#3730) --- ui/v2.5/src/hooks/Lightbox/Lightbox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/v2.5/src/hooks/Lightbox/Lightbox.tsx b/ui/v2.5/src/hooks/Lightbox/Lightbox.tsx index ca79805d7..bae92ab0c 100644 --- a/ui/v2.5/src/hooks/Lightbox/Lightbox.tsx +++ b/ui/v2.5/src/hooks/Lightbox/Lightbox.tsx @@ -466,7 +466,7 @@ export const LightboxComponent: React.FC = ({ 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;