Skip to content
Open
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
9 changes: 7 additions & 2 deletions packages/app/src/components/reader/FoliateViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2856,9 +2856,14 @@ export const FoliateViewer = forwardRef<FoliateViewerHandle, FoliateViewerProps>
view.addEventListener("link", linkHandler);
setViewReady(true);

// Navigate to last location or start
// Navigate to last location or start.
// Fixed-layout books (PDF/CBZ) restore via their fake page CFI
// (epubcfi(/6/N)), which the PDF backend's resolveCFI maps back to
// the recorded page — same mechanism as annotation navigation.
if (isFixedLayout) {
await view.init({});
console.log("[PDFRestore] init lastLocation =", JSON.stringify(lastLocation));
await view.init(lastLocation ? { lastLocation } : {});
console.log("[PDFRestore] init done, current index =", view.renderer?.index);
} else if (lastLocation) {
try {
await view.init({ lastLocation });
Expand Down