From f25a36b8eac94abc0ef44f19d46e72c695e86edd Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 3 Oct 2019 15:06:05 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt | 2 +- .../io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ?: ""