Properly detect downloadable chapter

This commit is contained in:
schroda
2024-09-18 12:49:03 +02:00
parent b05660dc82
commit 34ebe82df1

View File

@@ -53,7 +53,7 @@ export class ChaptersWithMeta {
static getDownloadable<Chapter extends ChapterWithMetaType>(chapters: Chapter[]): Chapter[] {
return chapters.filter(
({ chapter, downloadChapter }) =>
!Chapters.isDownloaded(chapter) && downloadChapter?.state !== DownloadState.Error,
!Chapters.isDownloaded(chapter) && (!downloadChapter || downloadChapter?.state === DownloadState.Error),
);
}