Fix a bug about remembering pgp passphrase

- Do not keep the wrong passphrase
This commit is contained in:
Yishi Lin 2017-05-08 21:12:48 +08:00
parent e1c6d9c0d8
commit 20f2e22076
2 changed files with 5 additions and 1 deletions

View file

@ -386,7 +386,9 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
} catch {
print(error)
DispatchQueue.main.async {
Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil)
// remove the wrong passphrase so that users could enter it next time
self.passwordStore.pgpKeyPassphrase = nil
Utils.alert(title: "Cannot Copy Password", message: error.localizedDescription, controller: self, completion: nil)
}
}
}