pull/1905/head^2
kunfei 3 years ago
parent c1977b8c1a
commit 40c40db86f
  1. 9
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt

@ -100,10 +100,10 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
val lastBackupFile = withContext(IO) { AppWebDav.lastBackUp().getOrNull() } val lastBackupFile = withContext(IO) { AppWebDav.lastBackUp().getOrNull() }
?: return@launch ?: return@launch
if (lastBackupFile.lastModify - LocalConfig.lastBackup > DateUtils.MINUTE_IN_MILLIS) { if (lastBackupFile.lastModify - LocalConfig.lastBackup > DateUtils.MINUTE_IN_MILLIS) {
LocalConfig.lastBackup = lastBackupFile.lastModify
alert("恢复", "webDav书源比本地新,是否恢复") { alert("恢复", "webDav书源比本地新,是否恢复") {
cancelButton() cancelButton()
okButton { okButton {
LocalConfig.lastBackup = lastBackupFile.lastModify
viewModel.restoreWebDav(lastBackupFile.displayName) viewModel.restoreWebDav(lastBackupFile.displayName)
} }
} }
@ -162,12 +162,13 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
if (LocalConfig.privacyPolicyOk) return if (LocalConfig.privacyPolicyOk) return
val privacyPolicy = String(assets.open("privacyPolicy.md").readBytes()) val privacyPolicy = String(assets.open("privacyPolicy.md").readBytes())
alert("用户隐私与协议", privacyPolicy) { alert("用户隐私与协议", privacyPolicy) {
noButton { noButton()
finish()
}
yesButton { yesButton {
LocalConfig.privacyPolicyOk = true LocalConfig.privacyPolicyOk = true
} }
onCancelled {
finish()
}
} }
} }

Loading…
Cancel
Save