pull/49/head
kunfei 5 years ago
parent 2bafc67895
commit fb66f6538f
  1. 6
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt

@ -17,7 +17,6 @@ import io.legado.app.help.ActivityHelp
import io.legado.app.help.permission.Permissions import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Backup
import io.legado.app.help.storage.Restore
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.noButton
import io.legado.app.lib.dialogs.yesButton import io.legado.app.lib.dialogs.yesButton
@ -63,10 +62,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
} }
private fun restore() { private fun restore() {
if (getPrefBoolean("dbChange")) {
Restore.restore()
putPrefBoolean("dbChange", false)
} else if (getPrefInt("versionCode") == 0) {
launch { launch {
if (withContext(IO) { App.db.bookDao().allBookCount == 0 }) { if (withContext(IO) { App.db.bookDao().allBookCount == 0 }) {
alert(title = "导入") { alert(title = "导入") {
@ -84,7 +79,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
} }
} }
} }
}
private fun upVersion() { private fun upVersion() {
if (getPrefInt("versionCode") != App.INSTANCE.versionCode) { if (getPrefInt("versionCode") != App.INSTANCE.versionCode) {

Loading…
Cancel
Save