Add confirmation prompt for removing keys (fix #491)

This commit is contained in:
Mingshen Sun 2021-12-29 16:19:12 -08:00
parent 7320319031
commit ff6a1edf62
7 changed files with 42 additions and 9 deletions

View file

@ -314,10 +314,13 @@ class GitRepositorySettingsTableViewController: UITableViewController, PasswordA
if Defaults.gitSSHKeySource != nil {
optionMenu.addAction(
UIAlertAction(title: "RemoveSShKeys".localize(), style: .destructive) { _ in
self.passwordStore.removeGitSSHKeys()
Defaults.gitSSHKeySource = nil
self.sshLabel?.isEnabled = false
self.gitAuthenticationMethod = .password
let alert = UIAlertController.removeConfirmationAlert(title: "RemoveSShKeys".localize(), message: "") { _ in
self.passwordStore.removeGitSSHKeys()
Defaults.gitSSHKeySource = nil
self.sshLabel?.isEnabled = false
self.gitAuthenticationMethod = .password
}
self.present(alert, animated: true, completion: nil)
}
)
}