From 973c1dec1ecb7dfd5bb010792d7fedbe7d5731a4 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 24 Oct 2023 17:15:03 +0800 Subject: [PATCH 1/2] When saving PDF read position always set it to the current page --- .../web/components/templates/article/PdfArticleContainer.tsx | 1 + .../lib/networking/mutations/articleReadingProgressMutation.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/web/components/templates/article/PdfArticleContainer.tsx b/packages/web/components/templates/article/PdfArticleContainer.tsx index 210b1b2ae..7e7c30681 100644 --- a/packages/web/components/templates/article/PdfArticleContainer.tsx +++ b/packages/web/components/templates/article/PdfArticleContainer.tsx @@ -413,6 +413,7 @@ export default function PdfArticleContainer( } await articleReadingProgressMutation({ id: props.article.id, + force: true, readingProgressPercent: percent, readingProgressAnchorIndex: pageIndex, }) diff --git a/packages/web/lib/networking/mutations/articleReadingProgressMutation.ts b/packages/web/lib/networking/mutations/articleReadingProgressMutation.ts index 6c41950d0..95fd754d7 100644 --- a/packages/web/lib/networking/mutations/articleReadingProgressMutation.ts +++ b/packages/web/lib/networking/mutations/articleReadingProgressMutation.ts @@ -3,6 +3,7 @@ import { gqlFetcher } from '../networkHelpers' export type ArticleReadingProgressMutationInput = { id: string + force?: boolean readingProgressPercent?: number readingProgressTopPercent?: number readingProgressAnchorIndex?: number From 95c984edf132ebf474142b8777e1db1b90cd1d8b Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 24 Oct 2023 17:18:26 +0800 Subject: [PATCH 2/2] Remove soptimization --- .../web/components/templates/article/PdfArticleContainer.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/web/components/templates/article/PdfArticleContainer.tsx b/packages/web/components/templates/article/PdfArticleContainer.tsx index 7e7c30681..4c8ba5bbd 100644 --- a/packages/web/components/templates/article/PdfArticleContainer.tsx +++ b/packages/web/components/templates/article/PdfArticleContainer.tsx @@ -408,9 +408,6 @@ export default function PdfArticleContainer( 100, Math.max(0, ((pageIndex + 1) / instance.totalPageCount) * 100) ) - if (percent <= props.article.readingProgressPercent) { - return - } await articleReadingProgressMutation({ id: props.article.id, force: true,