Implement fail-safe mechanism if key id is not found

This commit is contained in:
Mingshen Sun 2020-04-17 23:56:14 -07:00
parent 0cae6af60d
commit 3e114daca1
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
11 changed files with 161 additions and 58 deletions

View file

@ -170,7 +170,7 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
Defaults.pgpKeySource = nil
})
}
optionMenu.addAction(UIAlertAction(title: "Cancel".localize(), style: .cancel, handler: nil))
optionMenu.addAction(UIAlertAction.cancel())
optionMenu.popoverPresentationController?.sourceView = pgpKeyTableViewCell
optionMenu.popoverPresentationController?.sourceRect = pgpKeyTableViewCell.bounds
present(optionMenu, animated: true)
@ -193,10 +193,9 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
self?.setPasscodeLock()
}
let cancelAction = UIAlertAction(title: "Cancel".localize(), style: .cancel, handler: nil)
optionMenu.addAction(removePasscodeAction)
optionMenu.addAction(changePasscodeAction)
optionMenu.addAction(cancelAction)
optionMenu.addAction(UIAlertAction.cancel())
optionMenu.popoverPresentationController?.sourceView = passcodeTableViewCell
optionMenu.popoverPresentationController?.sourceRect = passcodeTableViewCell.bounds
self.present(optionMenu, animated: true, completion: nil)
@ -240,7 +239,7 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
saveAction.isEnabled = false // disable the Save button by default
// cancel action
let cancelAction = UIAlertAction(title: "Cancel".localize(), style: .cancel, handler: nil)
let cancelAction = UIAlertAction.cancel()
// present
setPasscodeLockAlert?.addAction(saveAction)