Fix marking chapter as read once end is reached by scrolling

This commit is contained in:
schroda
2026-05-20 13:05:04 +02:00
parent 13914333c0
commit 67d861c51b
3 changed files with 4 additions and 3 deletions

View File

@@ -498,7 +498,6 @@ export class ReaderControls {
(image) =>
image &&
isPageInViewport(image, type, {
truncateValues: true,
thresholds: {
bottom: 1,
left: getOptionForDirection(

View File

@@ -351,7 +351,7 @@ type InViewportOptions = {
};
const getIsPageInViewportInfo = (
element: HTMLElement,
{ truncateValues, thresholds: argThresholds }: InViewportOptions = { truncateValues: false, thresholds: {} },
{ truncateValues, thresholds: argThresholds }: InViewportOptions = { truncateValues: true, thresholds: {} },
): {
isLeftInViewport: boolean;
isRightInViewport: boolean;
@@ -425,8 +425,9 @@ export const isEndOfPageInViewport = (
element: HTMLElement,
type: PageInViewportType,
direction: ReadingDirection,
options?: InViewportOptions,
): boolean => {
const { isLeftInViewport, isRightInViewport, isBottomInViewport } = getIsPageInViewportInfo(element);
const { isLeftInViewport, isRightInViewport, isBottomInViewport } = getIsPageInViewportInfo(element, options);
switch (type) {
case PageInViewportType.X: