diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 98128c2f2..e637d3eb5 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -298,7 +298,13 @@ class BookInfoActivity : } requestCodeChapterList -> if (resultCode == Activity.RESULT_OK) { viewModel.bookData.value?.let { - readBook(it) + data?.getIntExtra("index", it.durChapterIndex)?.let { index -> + if (it.durChapterIndex != index) { + it.durChapterIndex = index + it.durChapterPos = 0 + } + readBook(it) + } } } } diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt index bace352ff..d7d7b0ab1 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt @@ -14,7 +14,6 @@ import io.legado.app.model.WebBook import kotlinx.coroutines.Dispatchers.IO class BookInfoViewModel(application: Application) : BaseViewModel(application) { - val bookData = MutableLiveData() val chapterListData = MutableLiveData>() val isLoadingData = MutableLiveData()