mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 02:44:34 -05:00
Load next chapter when getting to the last page (#84)
* Load next chapter when scrolling to the bottom (Webtoon, Continues Vertical) * Load next chapter when scrolling to the bottom (Paged reader) * Added missing types to IReaderProps * Move load next chapter when at last page to VerticalReader * Dependency fix * Use react history for loading next page
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import Page from '../Page';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
@@ -23,13 +24,19 @@ const useStyles = makeStyles({
|
||||
|
||||
export default function PagedReader(props: IReaderProps) {
|
||||
const {
|
||||
pages, settings, setCurPage, curPage,
|
||||
pages, settings, setCurPage, curPage, manga, chapter,
|
||||
} = props;
|
||||
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
|
||||
function nextPage() {
|
||||
if (curPage < pages.length - 1) { setCurPage(curPage + 1); }
|
||||
if (curPage < pages.length - 1) {
|
||||
setCurPage(curPage + 1);
|
||||
} else if (settings.loadNextonEnding) {
|
||||
setCurPage(0);
|
||||
history.push(`/manga/${manga.id}/chapter/${chapter.index + 1}`);
|
||||
}
|
||||
}
|
||||
|
||||
function prevPage() {
|
||||
|
||||
Reference in New Issue
Block a user