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 7b9dd284a..3001575e5 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 @@ -269,9 +269,7 @@ class ReaderActivity : BaseActivity() { */ override fun onSaveInstanceState(outState: Bundle) { outState.putBoolean(::menuVisible.name, menuVisible) - if (!isChangingConfigurations) { - viewModel.onSaveInstanceStateNonConfigurationChange() - } + viewModel.onSaveInstanceState() super.onSaveInstanceState(outState) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt index c4c7bfb13..ce2dfcecc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt @@ -232,10 +232,10 @@ class ReaderViewModel( } /** - * Called when the activity is saved and not changing configurations. It updates the database + * Called when the activity is saved. It updates the database * to persist the current progress of the active chapter. */ - fun onSaveInstanceStateNonConfigurationChange() { + fun onSaveInstanceState() { val currentChapter = getCurrentChapter() ?: return viewModelScope.launchNonCancellable { saveChapterProgress(currentChapter) @@ -512,6 +512,7 @@ class ReaderViewModel( private suspend fun saveChapterProgress(readerChapter: ReaderChapter) { if (!incognitoMode || hasTrackers) { val chapter = readerChapter.chapter + getCurrentChapter()?.requestedPage = chapter.last_page_read updateChapter.await( ChapterUpdate( id = chapter.id!!,