Prevent unnecessary chapter updated due to restoring last read page (#621)
When resuming a chapter and restoring the last read page, a chapter update was send for the just restored page
This commit is contained in:
@@ -355,6 +355,11 @@ export function Reader() {
|
||||
return;
|
||||
}
|
||||
|
||||
const chapterUpToDate = Chapters.getFromCache<TChapter>(chapter.id);
|
||||
if (curPageDebounced === chapterUpToDate?.lastPageRead) {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user