Add confirmation prompt for removing keys (fix #491)
This commit is contained in:
parent
7320319031
commit
ff6a1edf62
7 changed files with 42 additions and 9 deletions
|
|
@ -184,11 +184,14 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
|
|||
if Defaults.pgpKeySource != nil {
|
||||
optionMenu.addAction(
|
||||
UIAlertAction(title: "RemovePgpKeys".localize(), style: .destructive) { _ in
|
||||
self.keychain.removeContent(for: PGPKey.PUBLIC.getKeychainKey())
|
||||
self.keychain.removeContent(for: PGPKey.PRIVATE.getKeychainKey())
|
||||
PGPAgent.shared.uninitKeys()
|
||||
self.pgpKeyTableViewCell.detailTextLabel?.text = "NotSet".localize()
|
||||
Defaults.pgpKeySource = nil
|
||||
let alert = UIAlertController.removeConfirmationAlert(title: "RemovePgpKeys".localize(), message: "") { _ in
|
||||
self.keychain.removeContent(for: PGPKey.PUBLIC.getKeychainKey())
|
||||
self.keychain.removeContent(for: PGPKey.PRIVATE.getKeychainKey())
|
||||
PGPAgent.shared.uninitKeys()
|
||||
self.pgpKeyTableViewCell.detailTextLabel?.text = "NotSet".localize()
|
||||
Defaults.pgpKeySource = nil
|
||||
}
|
||||
self.present(alert, animated: true, completion: nil)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue