Skip to content

Commit

Permalink
Minor: hide reload button for custom page novels
Browse files Browse the repository at this point in the history
  • Loading branch information
nyagami committed Jul 7, 2024
1 parent b45a30f commit 5262567
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/hooks/persisted/useNovel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export const useNovel = (novelPath: string, pluginId: string) => {
novelSettings.filter,
page,
);
if (!chapters.length) {
if (!chapters.length && Number(page)) {
const sourcePage = await fetchPage(pluginId, novelPath, page);
const sourceChapters = sourcePage.chapters.map(ch => {
return {
Expand All @@ -368,14 +368,14 @@ export const useNovel = (novelPath: string, pluginId: string) => {
);
}
setChapters(chapters);
setLoading(false);
}
setLoading(false);
}, [novel, novelSettings, pageIndex]);
useEffect(() => {
getNovel();
}, []);
useEffect(() => {
getChapters();
getChapters().catch(e => showToast(e.message));
}, [getChapters]);

return {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/novel/components/Info/NovelInfoHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const NovelInfoHeader = ({
{`${chapters?.length} ${getString('novelScreen.chapters')}`}
</Text>
</View>
{page ? (
{page && Number(page) ? (
<IconButton
icon="reload"
iconColor={theme.onSurface}
Expand Down

0 comments on commit 5262567

Please sign in to comment.