pull/49/head
kunfei 5 years ago
parent bce55124ea
commit b3965bf850
  1. 2
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt

@ -255,7 +255,7 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
viewModel.groupData.postValue(group) viewModel.groupData.postValue(group)
viewModel.bookData.value?.group = group.groupId viewModel.bookData.value?.group = group.groupId
if (viewModel.inBookshelf) { if (viewModel.inBookshelf) {
viewModel.saveBook { } viewModel.saveBook()
} }
} }

@ -148,7 +148,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
} }
} }
fun saveBook(success: (() -> Unit)?) { fun saveBook(success: (() -> Unit)? = null) {
execute { execute {
bookData.value?.let { book -> bookData.value?.let { book ->
App.db.bookDao().insert(book) App.db.bookDao().insert(book)

Loading…
Cancel
Save