diff --git a/src/components/chapter/ChapterActionMenuItems.tsx b/src/components/chapter/ChapterActionMenuItems.tsx index c48c5b93..ef50418a 100644 --- a/src/components/chapter/ChapterActionMenuItems.tsx +++ b/src/components/chapter/ChapterActionMenuItems.tsx @@ -109,11 +109,6 @@ export const ChapterActionMenuItems = ({ } } - if (!chaptersWithMeta.length) { - onClose(); - return; - } - const getChapters = (): (ChapterDownloadInfo & ChapterBookmarkInfo & ChapterReadInfo)[] => { // select mode if (!chapter) { @@ -134,6 +129,13 @@ export const ChapterActionMenuItems = ({ return allChapters.slice(index + 1); }; + const chapters = getChapters(); + + if (!chapters.length) { + onClose(); + return; + } + Chapters.performAction(actualAction, chapter ? [chapter.id] : ChaptersWithMeta.getIds(chaptersWithMeta), { chapters: getChapters(), wasManuallyMarkedAsRead: true,