Fix TypeError in Mangas::downloadChapters
In case a manga was completely downloaded, the grouped chapters did not contain a list for the specific manga id, resulting in an TypeError due to trying to use the array as if it was not undefined
This commit is contained in:
@@ -314,7 +314,9 @@ export class Chapters {
|
||||
): T[] {
|
||||
const chapterNumberToChapters = Object.groupBy(allChapters, ({ chapterNumber }) => chapterNumber);
|
||||
|
||||
return uniqueChapters.map(({ chapterNumber }) => chapterNumberToChapters[chapterNumber]!).flat();
|
||||
return uniqueChapters
|
||||
.map((uniqueChapter) => chapterNumberToChapters[uniqueChapter.chapterNumber] ?? [uniqueChapter])
|
||||
.flat();
|
||||
}
|
||||
|
||||
static removeDuplicates<T extends ChapterScanlatorInfo & ChapterNumberInfo>(currentChapter: T, chapters: T[]): T[] {
|
||||
|
||||
Reference in New Issue
Block a user