diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 80aa186b1d..d3d1858ef4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -493,6 +493,11 @@ class ReaderActivity : BaseRxActivity(), please_wait.startAnimation(AnimationUtils.loadAnimation(this, R.anim.fade_in_long)) } + override fun onPause() { + presenter.saveProgress() + super.onPause() + } + /** * Called from the presenter whenever a new [viewerChapters] have been set. It delegates the * method to the current viewer, but also set the subtitle on the toolbar. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt index 7e6a94f494..2c95e34467 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt @@ -391,6 +391,8 @@ class ReaderPresenter( saveChapterHistory(fromChapter) } + fun saveProgress() = getCurrentChapter()?.let { onChapterChanged(it) } + /** * Saves this [chapter] progress (last read page and whether it's read). */