diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index e2fdd270f..6362c947f 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -54,12 +54,8 @@ class BookSourceEditActivity : viewModel.sourceLiveData.observe(this, Observer { upRecyclerView(it) }) - if (viewModel.sourceLiveData.value == null) { - intent.getStringExtra("data")?.let { - viewModel.setBookSource(it) - } - } else { - upRecyclerView(viewModel.sourceLiveData.value) + intent.getStringExtra("data")?.let { + viewModel.setBookSource(it) } } diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index 002818d82..5eed4540c 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -49,12 +49,8 @@ class RssSourceEditActivity : viewModel.sourceLiveData.observe(this, Observer { upRecyclerView(it) }) - if (viewModel.sourceLiveData.value == null) { - intent.getStringExtra("data")?.let { - viewModel.setSource(it) - } - } else { - upRecyclerView(viewModel.sourceLiveData.value) + intent.getStringExtra("data")?.let { + viewModel.setSource(it) } }