Prevent invalid page request
The page of the default state was rendered which caused a request to the base url (e.g. http://localhost:4567).
This commit is contained in:
@@ -56,6 +56,7 @@ export const Reader = () => {
|
||||
setTotalPages,
|
||||
setCurrentPageIndex,
|
||||
setPageToScrollToIndex,
|
||||
pages,
|
||||
setPages,
|
||||
setPageUrls,
|
||||
setPageLoadStates,
|
||||
@@ -334,6 +335,11 @@ export const Reader = () => {
|
||||
return null;
|
||||
}
|
||||
|
||||
const isPlaceholderPageState = pages.length === 1 && pages[0].primary.url === requestManager.getBaseUrl();
|
||||
if (isPlaceholderPageState) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ReaderHotkeys scrollElementRef={scrollElementRef} />
|
||||
|
||||
Reference in New Issue
Block a user