diff --git a/app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt b/app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt index 7f094ebc4..36715bcf8 100644 --- a/app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt +++ b/app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt @@ -78,9 +78,7 @@ object BackupRestoreUi { } fun selectBackupFolder(fragment: Fragment, requestCode: Int = selectFolderRequestCode) { - FilePicker.selectFolder(fragment, requestCode) { - backupUsePermission(fragment, requestCode = requestCode) - } + FilePicker.selectFolder(fragment, requestCode) } fun restore(fragment: Fragment) { @@ -97,13 +95,13 @@ object BackupRestoreUi { Restore.restore(fragment.requireContext(), backupPath) fragment.toast(R.string.restore_success) } else { - selectRestoreFolder(fragment) + selectBackupFolder(fragment, restoreSelectRequestCode) } } else { restoreUsePermission(fragment, backupPath) } } else { - selectRestoreFolder(fragment) + selectBackupFolder(fragment, restoreSelectRequestCode) } } } @@ -124,12 +122,6 @@ object BackupRestoreUi { .request() } - private fun selectRestoreFolder(fragment: Fragment) { - FilePicker.selectFolder(fragment, restoreSelectRequestCode) { - restoreUsePermission(fragment) - } - } - fun importOldData(fragment: Fragment) { FilePicker.selectFolder(fragment, oldDataRequestCode) { importOldUsePermission(fragment)