优化
This commit is contained in:
@@ -137,7 +137,7 @@ class AddToBookshelfDialog() : BaseDialogFragment(R.layout.dialog_add_to_bookshe
|
|||||||
}
|
}
|
||||||
throw NoStackTraceException("未找到匹配书源")
|
throw NoStackTraceException("未找到匹配书源")
|
||||||
}.onError {
|
}.onError {
|
||||||
AppLog.put("添加书籍 ${bookUrl} 出错", it)
|
AppLog.put("添加书籍 $bookUrl 出错", it)
|
||||||
loadErrorLiveData.postValue(it.localizedMessage)
|
loadErrorLiveData.postValue(it.localizedMessage)
|
||||||
}.onSuccess {
|
}.onSuccess {
|
||||||
book = it
|
book = it
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ class OnLineImportActivity :
|
|||||||
finallyDialog(getString(R.string.error), it)
|
finallyDialog(getString(R.string.error), it)
|
||||||
}
|
}
|
||||||
intent.data?.let {
|
intent.data?.let {
|
||||||
val url = it.toString().substringAfter("src=", "")
|
val url = it.getQueryParameter("src")
|
||||||
if (url.isEmpty()) {
|
if (url.isNullOrEmpty()) {
|
||||||
finish()
|
finish()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class RssArticlesViewModel(application: Application) : BaseViewModel(application
|
|||||||
Rss.getArticles(viewModelScope, sortName, pageUrl, rssSource, page).onSuccess(IO) {
|
Rss.getArticles(viewModelScope, sortName, pageUrl, rssSource, page).onSuccess(IO) {
|
||||||
nextPageUrl = it.second
|
nextPageUrl = it.second
|
||||||
loadMoreSuccess(it.first)
|
loadMoreSuccess(it.first)
|
||||||
|
isLoading = false
|
||||||
}.onError {
|
}.onError {
|
||||||
loadFinallyLiveData.postValue(false)
|
loadFinallyLiveData.postValue(false)
|
||||||
AppLog.put("rss获取内容失败", it)
|
AppLog.put("rss获取内容失败", it)
|
||||||
@@ -88,7 +89,6 @@ class RssArticlesViewModel(application: Application) : BaseViewModel(application
|
|||||||
}
|
}
|
||||||
appDb.rssArticleDao.insert(*articles.toTypedArray())
|
appDb.rssArticleDao.insert(*articles.toTypedArray())
|
||||||
}
|
}
|
||||||
isLoading = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user