mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
Update ReadBookViewModel.kt
This commit is contained in:
parent
04d60f3a46
commit
09580efc80
@ -186,13 +186,10 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
||||
book: Book,
|
||||
alertSync: ((progress: BookProgress) -> Unit)? = null
|
||||
) {
|
||||
if (!AppWebDav.syncBookProgress) return
|
||||
execute {
|
||||
if (AppWebDav.syncBookProgress) {
|
||||
AppWebDav.getBookProgress(book)
|
||||
?: throw NoStackTraceException("没有进度")
|
||||
} else {
|
||||
throw NoStackTraceException("进度同步未启用")
|
||||
}
|
||||
AppWebDav.getBookProgress(book)
|
||||
?: throw NoStackTraceException("没有进度")
|
||||
}.onError {
|
||||
AppLog.put("拉取阅读进度失败", it)
|
||||
}.onSuccess { progress ->
|
||||
@ -494,4 +491,4 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user