pull/38/head
kunfei 5 years ago
parent 65ea5e4d3a
commit aa7e21bf2c
  1. 13
      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) loadChapter(it, changeDruChapterIndex)
} }
}.onError { }.onError {
isLoadingData.postValue(false)
toast(R.string.error_get_book_info) 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) changeDruChapterIndex(it)
} }
} else { } else {
isLoadingData.postValue(false)
toast(R.string.chapter_list_empty) toast(R.string.chapter_list_empty)
} }
} }
}.onError { }.onError {
isLoadingData.postValue(false)
toast(R.string.error_get_chapter_list) toast(R.string.error_get_chapter_list)
} }
} ?: toast(R.string.error_no_source) } ?: let {
isLoadingData.postValue(false)
toast(R.string.error_no_source)
}
} }
} }

Loading…
Cancel
Save