Fix marking chapter as read once end is reached by scrolling
This commit is contained in:
@@ -498,7 +498,6 @@ export class ReaderControls {
|
||||
(image) =>
|
||||
image &&
|
||||
isPageInViewport(image, type, {
|
||||
truncateValues: true,
|
||||
thresholds: {
|
||||
bottom: 1,
|
||||
left: getOptionForDirection(
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user