Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added FETCH_HEAD
Empty file.
13 changes: 8 additions & 5 deletions src/components/newPdfViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLInputElement>) => {
Expand Down Expand Up @@ -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"
/>
<span className="text-xs font-medium text-white">of {totalPages ?? 1}</span>
<span className="text-xs font-medium text-white">of {totalPages ?? "..."}</span>
</div>
)

Expand Down
15 changes: 15 additions & 0 deletions taginggit pull origin staginggit pull origin staging
Original file line number Diff line number Diff line change
@@ -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
Loading