Add option to open specific chapter via "useOpenChapter"

This commit is contained in:
schroda
2025-01-28 01:30:05 +01:00
parent 45b4874348
commit 4789a74785
3 changed files with 96 additions and 49 deletions

View File

@@ -165,3 +165,18 @@ export const createUpdateReaderPageLoadState =
return statePageLoadStates.toSpliced(index, 1, { url: pageLoadState.url, loaded: true });
});
};
export const getReaderOpenChapterResumeMode = (
isSpecificChapterMode: boolean,
isPreviousChapter: boolean,
): ReaderResumeMode | undefined => {
if (!isSpecificChapterMode) {
return undefined;
}
if (isPreviousChapter) {
return ReaderResumeMode.END;
}
return ReaderResumeMode.START;
};