diff --git a/app/src/main/java/io/legado/app/ui/booksource/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/booksource/BookSourceActivity.kt index 3486589a8..c1a0c6e36 100644 --- a/app/src/main/java/io/legado/app/ui/booksource/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/booksource/BookSourceActivity.kt @@ -4,7 +4,6 @@ import android.content.Intent import android.os.Bundle import android.view.Menu import android.view.MenuItem -import android.view.View import androidx.appcompat.widget.SearchView import androidx.lifecycle.LiveData import androidx.lifecycle.Observer @@ -125,15 +124,11 @@ class BookSourceActivity : VMBaseActivity(R.layout.activity } override fun del(bookSource: BookSource) { - launch(IO) { App.db.bookSourceDao().delete(bookSource) } - } - - override fun update(bookSource: BookSource) { - launch(IO) { App.db.bookSourceDao().update(bookSource) } + viewModel.del(bookSource) } override fun update(vararg bookSource: BookSource) { - launch(IO) { App.db.bookSourceDao().update(*bookSource) } + viewModel.update(*bookSource) } override fun edit(bookSource: BookSource) { diff --git a/app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt index 1d6869cb4..a89a01b68 100644 --- a/app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/booksource/BookSourceAdapter.kt @@ -92,7 +92,6 @@ class BookSourceAdapter : PagedListAdapter