diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/app/passwordstore/ui/git/config/GitServerConfigActivity.kt | 5 | ||||
-rw-r--r-- | app/src/main/java/app/passwordstore/ui/settings/RepositorySettings.kt | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/src/main/java/app/passwordstore/ui/git/config/GitServerConfigActivity.kt b/app/src/main/java/app/passwordstore/ui/git/config/GitServerConfigActivity.kt index 78f1aa2b..0fab992f 100644 --- a/app/src/main/java/app/passwordstore/ui/git/config/GitServerConfigActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/git/config/GitServerConfigActivity.kt @@ -242,7 +242,10 @@ class GitServerConfigActivity : BaseGitActivity() { message = getString(R.string.delete_directory_progress_text), length = Snackbar.LENGTH_INDEFINITE ) - withContext(Dispatchers.IO) { localDir.deleteRecursively() } + withContext(Dispatchers.IO) { + localDir.deleteRecursively() + localDir.mkdirs() + } snackbar.dismiss() launchGitOperation(GitOp.CLONE) .fold( diff --git a/app/src/main/java/app/passwordstore/ui/settings/RepositorySettings.kt b/app/src/main/java/app/passwordstore/ui/settings/RepositorySettings.kt index 8b478d63..8bd61f41 100644 --- a/app/src/main/java/app/passwordstore/ui/settings/RepositorySettings.kt +++ b/app/src/main/java/app/passwordstore/ui/settings/RepositorySettings.kt @@ -162,8 +162,11 @@ class RepositorySettings(private val activity: FragmentActivity) : SettingsProvi .setCancelable(false) .setPositiveButton(R.string.dialog_delete) { dialogInterface, _ -> runCatching { - PasswordRepository.getRepositoryDirectory().deleteRecursively() PasswordRepository.closeRepository() + PasswordRepository.getRepositoryDirectory().let { dir -> + dir.deleteRecursively() + dir.mkdirs() + } } .onFailure { it.message?.let { message -> activity.snackbar(message = message) } } |