Use correct chapter list for guard condition (#676)
In case of the "mark_prev_read" as read action, the passed chapter list was empty and thus the guard to exit early was incorrectly triggered
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user