update table cell details label after setting PGP key

This commit is contained in:
Bob Sun 2017-02-07 11:47:39 +08:00
parent c2dd6533d9
commit 32237b2283
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
2 changed files with 3 additions and 2 deletions

View file

@ -85,10 +85,11 @@ class SettingsTableViewController: UITableViewController {
SVProgressHUD.setDefaultMaskType(.black)
SVProgressHUD.show(withStatus: "Fetching PGP Key")
DispatchQueue.global(qos: .userInitiated).async {
DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
do {
try PasswordStore.shared.initPGP(pgpKeyURL: Defaults[.pgpKeyURL]!, pgpKeyLocalPath: Globals.shared.secringPath)
DispatchQueue.main.async {
self.pgpKeyTableViewCell.detailTextLabel?.text = Defaults[.pgpKeyID]
SVProgressHUD.showSuccess(withStatus: "Success. Remember to remove the key from the server.")
SVProgressHUD.dismiss(withDelay: 1)
}