修复webDav连接不上时webDav界面无响应的bug

pull/1959/head
kunfei 3 years ago
parent fb7d29df9e
commit d7d586d13d
  1. 13
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -65,11 +65,8 @@ import io.legado.app.ui.widget.PopupAction
import io.legado.app.ui.widget.dialog.PhotoDialog
import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.utils.*
import kotlinx.coroutines.*
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
class ReadBookActivity : BaseReadBookActivity(),
View.OnTouchListener,
@ -1063,9 +1060,11 @@ class ReadBookActivity : BaseReadBookActivity(),
backupJob?.cancel()
backupJob = launch {
delay(120000)
ReadBook.book?.let {
AppWebDav.uploadBookProgress(it)
Backup.autoBack(this@ReadBookActivity)
withContext(IO) {
ReadBook.book?.let {
AppWebDav.uploadBookProgress(it)
Backup.autoBack(this@ReadBookActivity)
}
}
}
}

Loading…
Cancel
Save