get first unread chapter from original chapter list (#250)

The first unread chapter was retrieved from the filtered and sorted chapter list, which could result in e.g. incorrectly recognizing the latest released chapter as the first unread chapter.

Ideally the server would return the manga with its last read chapter, but this is currently not available.
This commit is contained in:
schroda
2023-03-03 10:39:11 +01:00
committed by GitHub
parent c6257acdf1
commit 9625436518

View File

@@ -110,11 +110,11 @@ const ChapterList: React.FC<IProps> = ({ mangaId }) => {
const firstUnreadChapter = useMemo(
() =>
visibleChapters
chapters
.slice()
.reverse()
.find((c) => c.read === false),
[visibleChapters],
.find((chapter) => !chapter.read),
[chapters],
);
const handleSelection = (index: number) => {