pull/801/head
gedoor 4 years ago
parent 231e315fc6
commit a76d64f040
  1. 2
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt

@ -88,6 +88,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio
} }
private fun searchFinish(searchBook: SearchBook) { private fun searchFinish(searchBook: SearchBook) {
if (searchBooks.contains(searchBook)) return
App.db.searchBookDao.insert(searchBook) App.db.searchBookDao.insert(searchBook)
if (screenKey.isEmpty()) { if (screenKey.isEmpty()) {
searchBooks.add(searchBook) searchBooks.add(searchBook)
@ -140,7 +141,6 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio
} else { } else {
searchFinish(searchBook) searchFinish(searchBook)
} }
return@onSuccess
} }
} }
} }

Loading…
Cancel
Save