Sort chapter list by source order
Was incorrectly changed to chapter number with f52b634da1
This commit is contained in:
@@ -91,7 +91,7 @@ export function filterAndSortChapters(chapters: TChapter[], options: ChapterList
|
|||||||
const sorted =
|
const sorted =
|
||||||
options.sortBy === 'fetchedAt'
|
options.sortBy === 'fetchedAt'
|
||||||
? filtered.toSorted((a, b) => Number(a.fetchedAt ?? 0) - Number(b.fetchedAt ?? 0))
|
? filtered.toSorted((a, b) => Number(a.fetchedAt ?? 0) - Number(b.fetchedAt ?? 0))
|
||||||
: filtered.toSorted((a, b) => a.chapterNumber - b.chapterNumber);
|
: filtered.toSorted((a, b) => a.sourceOrder - b.sourceOrder);
|
||||||
if (options.reverse) {
|
if (options.reverse) {
|
||||||
sorted.reverse();
|
sorted.reverse();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user