diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt index 3a340f617..4a455ab53 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt @@ -16,7 +16,6 @@ import kotlinx.coroutines.Dispatchers class AudioPlayViewModel(application: Application) : BaseViewModel(application) { var inBookshelf = false var bookData = MutableLiveData() - val chapterListFinish = MutableLiveData() var chapterSize = 0 var callBack: ReadBookViewModel.CallBack? = null var durChapterIndex = 0 @@ -53,7 +52,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application) durChapterIndex = count - 1 } chapterSize = count - chapterListFinish.postValue(true) + callBack?.loadContent() } } saveRead(book) @@ -83,7 +82,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application) if (changeDruChapterIndex == null) { App.db.bookChapterDao().insert(*cList.toTypedArray()) chapterSize = cList.size - chapterListFinish.postValue(true) + callBack?.loadContent() } else { changeDruChapterIndex(cList) }