pull/32/head
kunfei 5 years ago
parent 8679723300
commit 99a5105cd2
  1. 6
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -14,8 +14,10 @@ import io.legado.app.model.WebBook
import io.legado.app.service.ReadAloudService
import io.legado.app.ui.widget.page.TextChapter
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
class ReadBookViewModel(application: Application) : BaseViewModel(application) {
var inBookshelf = false
@ -228,7 +230,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
prevTextChapter = null
curTextChapter = null
nextTextChapter = null
callBack?.upContent()
withContext(Main) {
callBack?.upContent()
}
App.db.bookDao().insert(book)
bookData.postValue(book)
App.db.bookSourceDao().getBookSource(book.origin)?.let {

Loading…
Cancel
Save