feat: local store read progress for later sync
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import { BookReader } from "./BookReader";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { ClientOfflineBookService } from "@/lib/services/client-offlinebook.service";
|
||||
|
||||
interface ClientBookWrapperProps {
|
||||
book: KomgaBook;
|
||||
@@ -12,10 +13,11 @@ interface ClientBookWrapperProps {
|
||||
export function ClientBookWrapper({ book, pages }: ClientBookWrapperProps) {
|
||||
const router = useRouter();
|
||||
|
||||
const handleCloseReader = () => {
|
||||
const handleCloseReader = (currentPage: number) => {
|
||||
fetch(`/api/komga/cache/clear/${book.libraryId}/${book.seriesId}`, {
|
||||
method: "POST",
|
||||
});
|
||||
ClientOfflineBookService.setCurrentPage(book, currentPage);
|
||||
router.back();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user