Change notification observer from "showPassword" to "decryptThenShowPassword"

- avoid crash when password has been deleted
This commit is contained in:
Bob Sun 2017-06-03 17:50:33 -07:00
parent 174128998c
commit e549db0714
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
2 changed files with 16 additions and 12 deletions

View file

@ -64,13 +64,13 @@ class Utils {
return randomString
}
static func alert(title: String, message: String, controller: UIViewController, completion: (() -> Void)?) {
static func alert(title: String, message: String, controller: UIViewController, handler: ((UIAlertAction) -> Void)? = nil, completion: (() -> Void)? = nil) {
SVProgressHUD.dismiss()
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: handler))
controller.present(alert, animated: true, completion: completion)
}
static func removePGPKeys() {
removeFileIfExists(atPath: Globals.pgpPublicKeyPath)