Do not update chapter in case it has not been loaded yet (#612)

This commit is contained in:
schroda
2024-02-18 15:20:37 +01:00
committed by GitHub
parent 5a9618aefe
commit 97ab4004a6

View File

@@ -182,6 +182,10 @@ export function Reader() {
);
const updateChapter = (patch: UpdateChapterPatchInput) => {
if (chapter === initialChapter) {
return;
}
const getChapterIdToDelete = () => {
const isAutoDeletionEnabled = !!patch.isRead && !!metadataSettings.deleteChaptersWhileReading;
if (!isAutoDeletionEnabled || !mangaChapters) {
@@ -347,6 +351,10 @@ export function Reader() {
return;
}
if (chapter === initialChapter) {
return;
}
// do not mutate the chapter, this will cause the page to jump around due to always scrolling to the last read page
const updateLastPageRead = curPageDebounced !== -1;
const updateIsRead = curPageDebounced === chapter.pageCount - 1;