fix: Handling page 0 on reader with localstorage cache

This commit is contained in:
Julien Froidefond
2025-03-02 07:24:18 +01:00
parent 2e9b191f98
commit c0a13abf4a
2 changed files with 5 additions and 4 deletions

View File

@@ -17,7 +17,8 @@ export const usePageNavigation = ({
onClose,
direction,
}: UsePageNavigationProps) => {
const [currentPage, setCurrentPage] = useState(ClientOfflineBookService.getCurrentPage(book));
const cPage = ClientOfflineBookService.getCurrentPage(book);
const [currentPage, setCurrentPage] = useState(cPage < 1 ? 1 : cPage);
const [isLoading, setIsLoading] = useState(true);
const [secondPageLoading, setSecondPageLoading] = useState(true);
const [zoomLevel, setZoomLevel] = useState(1);