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 6362c947f..b1c659b9b 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 @@ -225,7 +225,7 @@ class BookSourceEditActivity : } private fun getSource(): BookSource? { - val source = viewModel.sourceLiveData.value ?: BookSource() + val source = viewModel.sourceLiveData.value?.copy() ?: BookSource() source.enabled = cb_is_enable.isChecked source.enabledExplore = cb_is_enable_find.isChecked viewModel.sourceLiveData.value?.let { 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 5eed4540c..c30e8b9ff 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 @@ -135,7 +135,7 @@ class RssSourceEditActivity : } private fun getRssSource(): RssSource? { - val source = viewModel.sourceLiveData.value ?: RssSource() + val source = viewModel.sourceLiveData.value?.copy() ?: RssSource() sourceEntities.forEach { when (it.key) { "sourceName" -> source.sourceName = it.value ?: ""