pull/1295/head
gedoor 3 years ago
parent 67e6bc3d3f
commit db178b64cb
  1. 2
      app/src/main/java/io/legado/app/help/storage/AppWebDav.kt
  2. 9
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -38,7 +38,7 @@ object AppWebDav {
return url return url
} }
private suspend fun initWebDav(): Boolean { suspend fun initWebDav(): Boolean {
val account = appCtx.getPrefString(PreferKey.webDavAccount) val account = appCtx.getPrefString(PreferKey.webDavAccount)
val password = appCtx.getPrefString(PreferKey.webDavPassword) val password = appCtx.getPrefString(PreferKey.webDavPassword)
if (!account.isNullOrBlank() && !password.isNullOrBlank()) { if (!account.isNullOrBlank() && !password.isNullOrBlank()) {

@ -51,11 +51,8 @@ import io.legado.app.ui.replace.ReplaceRuleActivity
import io.legado.app.ui.replace.edit.ReplaceEditActivity import io.legado.app.ui.replace.edit.ReplaceEditActivity
import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.utils.* import io.legado.app.utils.*
import kotlinx.coroutines.*
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
class ReadBookActivity : ReadBookBaseActivity(), class ReadBookActivity : ReadBookBaseActivity(),
View.OnTouchListener, View.OnTouchListener,
@ -210,6 +207,10 @@ class ReadBookActivity : ReadBookBaseActivity(),
} }
} }
} }
launch {
menu.findItem(R.id.menu_get_progress)?.isVisible =
withContext(IO) { AppWebDav.initWebDav() }
}
} }
} }

Loading…
Cancel
Save