Correctly check if chapter exists
The wrong chapter list was used. "chapters" is the filtered list of chapters, which e.g. doesn't contain duplicated chapters. This caused the "chapter source order" to potentially be higher than the total chapters of the manga. The end result of this was that the fetched state of the pages wasn't properly detected causing errors due to rendering the reader before it was in the correct state
This commit is contained in:
@@ -83,7 +83,7 @@ const BaseReader = ({
|
||||
setSettings,
|
||||
initialChapter,
|
||||
currentChapter,
|
||||
chapters,
|
||||
mangaChapters,
|
||||
setReaderStateChapters,
|
||||
firstPageUrl,
|
||||
totalPages,
|
||||
@@ -105,7 +105,7 @@ const BaseReader = ({
|
||||
'shouldSkipDupChapters' | 'backgroundColor' | 'shouldShowReadingModePreview' | 'shouldShowTapZoneLayoutPreview'
|
||||
> &
|
||||
Pick<IReaderSettingsWithDefaultFlag, 'readingMode' | 'tapZoneLayout' | 'tapZoneInvertMode'> &
|
||||
Pick<ReaderStateChapters, 'initialChapter' | 'currentChapter' | 'chapters' | 'setReaderStateChapters'> &
|
||||
Pick<ReaderStateChapters, 'initialChapter' | 'currentChapter' | 'mangaChapters' | 'setReaderStateChapters'> &
|
||||
Pick<
|
||||
ReaderStatePages,
|
||||
| 'totalPages'
|
||||
@@ -164,7 +164,7 @@ const BaseReader = ({
|
||||
!chaptersResponse.loading &&
|
||||
!chaptersResponse.error &&
|
||||
chapterSourceOrder >= 0 &&
|
||||
chapterSourceOrder <= chapters.length;
|
||||
chapterSourceOrder <= mangaChapters.length;
|
||||
|
||||
const isLoading =
|
||||
currentChapter === undefined ||
|
||||
@@ -532,7 +532,7 @@ export const Reader = withPropsFrom(
|
||||
'setSettings',
|
||||
'initialChapter',
|
||||
'currentChapter',
|
||||
'chapters',
|
||||
'mangaChapters',
|
||||
'setReaderStateChapters',
|
||||
'firstPageUrl',
|
||||
'totalPages',
|
||||
|
||||
Reference in New Issue
Block a user