From aa7e21bf2c1974527e951726564b81b57b1d0070 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 22 Oct 2019 08:43:27 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/book/info/BookInfoViewModel.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt index dc96b4c0c..c1b992275 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt @@ -66,9 +66,13 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { loadChapter(it, changeDruChapterIndex) } }.onError { + isLoadingData.postValue(false) toast(R.string.error_get_book_info) } - } ?: toast(R.string.error_no_source) + } ?: let { + isLoadingData.postValue(false) + toast(R.string.error_no_source) + } } } @@ -94,13 +98,18 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { changeDruChapterIndex(it) } } else { + isLoadingData.postValue(false) toast(R.string.chapter_list_empty) } } }.onError { + isLoadingData.postValue(false) toast(R.string.error_get_chapter_list) } - } ?: toast(R.string.error_no_source) + } ?: let { + isLoadingData.postValue(false) + toast(R.string.error_no_source) + } } }