Skip to content

Commit

Permalink
get first unread chapter from original chapter list (#250)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
schroda authored Mar 3, 2023
1 parent c6257ac commit 9625436
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/manga/ChapterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 9625436

Please sign in to comment.