From 96254365182cf02425c17649dece4bb7554f9985 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 3 Mar 2023 10:39:11 +0100 Subject: [PATCH] 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. --- src/components/manga/ChapterList.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/manga/ChapterList.tsx b/src/components/manga/ChapterList.tsx index 00373df49c..4941ae7f1a 100644 --- a/src/components/manga/ChapterList.tsx +++ b/src/components/manga/ChapterList.tsx @@ -110,11 +110,11 @@ const ChapterList: React.FC = ({ mangaId }) => { const firstUnreadChapter = useMemo( () => - visibleChapters + chapters .slice() .reverse() - .find((c) => c.read === false), - [visibleChapters], + .find((chapter) => !chapter.read), + [chapters], ); const handleSelection = (index: number) => {