mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
166ff99da8
commit
1a25cb9615
@ -55,7 +55,7 @@ interface JsExtensions {
|
||||
val analyzeUrl = AnalyzeUrl(urlStr, source = getSource())
|
||||
analyzeUrl.getStrResponseAwait().body
|
||||
}.onFailure {
|
||||
log("ajax(${urlStr}) error\n${it.stackTraceToString()}")
|
||||
AppLog.put("ajax(${urlStr}) error\n${it.localizedMessage}", it)
|
||||
it.printOnDebug()
|
||||
}.getOrElse {
|
||||
it.msg
|
||||
|
@ -191,6 +191,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
||||
} else {
|
||||
throw NoStackTraceException("进度同步未启用")
|
||||
}
|
||||
}.onError {
|
||||
AppLog.put("拉取阅读进度失败", it)
|
||||
}.onSuccess { progress ->
|
||||
if (progress.durChapterIndex < book.durChapterIndex ||
|
||||
(progress.durChapterIndex == book.durChapterIndex
|
||||
@ -199,7 +201,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
||||
alertSync?.invoke(progress)
|
||||
} else {
|
||||
ReadBook.setProgress(progress)
|
||||
context.toastOnUi("自动同步阅读进度成功")
|
||||
AppLog.put("自动同步阅读进度成功")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user