diff --git a/FETCH_HEAD b/FETCH_HEAD new file mode 100644 index 0000000..e69de29 diff --git a/src/components/newPdfViewer.tsx b/src/components/newPdfViewer.tsx index a2c47ab..e5c6373 100644 --- a/src/components/newPdfViewer.tsx +++ b/src/components/newPdfViewer.tsx @@ -65,11 +65,14 @@ const Controls = memo(function Controls({documentId, toggleFullscreen, isFullscr useEffect(() => { if (!scrollProv) return; - const unsub = scrollProv.onPageChange(() => - setPageNo(String(scrollProv.getCurrentPage())) - ); + const unsub = scrollProv.onPageChange(() => { + const current = scrollProv.getCurrentPage(); + setPageNo(String(current)); + }); + const current = scrollProv.getCurrentPage(); + setPageNo(String(current)); return () => unsub(); - }, [scrollProv]); + }, [scrollProv, scrollState?.totalPages]); const pageChange = useCallback( (e: React.KeyboardEvent) => { @@ -105,7 +108,7 @@ const Controls = memo(function Controls({documentId, toggleFullscreen, isFullscr onFocus={() => setPageNo("")} className="h-9 w-14 rounded border bg-[#e7e9ff] p-1 text-center text-sm [appearance:textfield] dark:bg-[#1f1f2a] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none" /> - of {totalPages ?? 1} + of {totalPages ?? "..."} ) diff --git a/taginggit pull origin staginggit pull origin staging b/taginggit pull origin staginggit pull origin staging new file mode 100644 index 0000000..8622090 --- /dev/null +++ b/taginggit pull origin staginggit pull origin staging @@ -0,0 +1,15 @@ + feat/paper-preview-modal + fix/accordion-toggle +* fix/pdf-viewer-page-count + staging + remotes/origin/HEAD -> origin/staging + remotes/origin/feat/paper-preview-modal + remotes/origin/fix/accordion-toggle + remotes/origin/fix/pdf-viewer-page-count + remotes/origin/staging + remotes/upstream/HEAD -> upstream/staging + remotes/upstream/dependabot/npm_and_yarn/axios-1.13.5 + remotes/upstream/dependabot/npm_and_yarn/lodash-4.17.23 + remotes/upstream/dependabot/npm_and_yarn/next-15.5.10 + remotes/upstream/prod + remotes/upstream/staging