Show missing chapter info in chapter list

Closes #836
This commit is contained in:
schroda
2025-05-24 20:32:03 +02:00
parent 86578593ca
commit 61471ae214
7 changed files with 164 additions and 16 deletions

View File

@@ -8,8 +8,8 @@
import { Virtuoso, VirtuosoProps } from 'react-virtuoso';
import { useMemo } from 'react';
import { ChapterCard } from '@/modules/chapter/components/cards/ChapterCard.tsx';
import { ReaderStateChapters } from '@/modules/reader/types/Reader.types.ts';
import { ChapterListCard } from '@/modules/chapter/components/cards/ChapterListCard.tsx';
const onSelectNoop = () => {};
@@ -33,10 +33,11 @@ export const ReaderChapterList = ({
totalCount={chapters.length}
computeItemKey={(index) => chapters[index].id}
itemContent={(index) => (
<ChapterCard
key={chapters[index].id}
<ChapterListCard
index={index}
chapters={chapters}
isSortDesc
mode="reader"
chapter={chapters[index]}
showChapterNumber={false}
selected={null}
onSelect={onSelectNoop}

View File

@@ -295,10 +295,7 @@ export class ReaderControls {
return;
}
const missingChapters = Math.max(
0,
Math.trunc(currentChapter.chapterNumber) - Math.trunc(chapterToOpen.chapterNumber) - 1,
);
const missingChapters = Chapters.getGap(currentChapter, chapterToOpen);
const isSameScanlator =
!shouldInformAboutScanlatorChange || currentChapter.scanlator === chapterToOpen.scanlator;
const isContinuousChapter = !shouldInformAboutMissingChapter || !missingChapters;