Immediately open previous/next chapter on reader nav bar button click

The logic didn't handle cases were the next/previous chapter wasn't loaded yet, which lead to the load happening in the background without any user feedback.
This commit is contained in:
schroda
2025-04-02 02:27:01 +02:00
parent 7a7a0dfa9c
commit 642708b8b3
5 changed files with 37 additions and 25 deletions

View File

@@ -161,7 +161,7 @@ const BaseReaderViewer = forwardRef(
ref: ForwardedRef<HTMLDivElement | null>,
) => {
const { direction: themeDirection } = useTheme();
const { resumeMode } = useLocation<ReaderOpenChapterLocationState>().state ?? {
const { resumeMode = ReaderResumeMode.START } = useLocation<ReaderOpenChapterLocationState>().state ?? {
resumeMode: ReaderResumeMode.START,
};