From 32237b228359a87db3a38aa84db5eb4806879d18 Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Tue, 7 Feb 2017 11:47:39 +0800 Subject: [PATCH] update table cell details label after setting PGP key --- pass.xcodeproj/project.pbxproj | 2 +- pass/SettingsTableViewController.swift | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pass.xcodeproj/project.pbxproj b/pass.xcodeproj/project.pbxproj index 99a7ae3..eb3b806 100644 --- a/pass.xcodeproj/project.pbxproj +++ b/pass.xcodeproj/project.pbxproj @@ -122,12 +122,12 @@ DCA0499D1E33BAC100522E8F /* Globals.swift */, DC4914941E434301007FF592 /* LabelTableViewCell.swift */, DCDDEAB11E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift */, + DCAAF7441E2FA66800AB94BC /* SettingsTableViewController.swift */, DC7E6EE91E432E48006C2443 /* Password.swift */, DC4914981E434600007FF592 /* PasswordDetailTableViewController.swift */, DCC408A31E2FCC9E00F29B0E /* PasswordStore.swift */, DC5734AD1E439AD400D09270 /* PasswordsViewController.swift */, DCA0499B1E3362F400522E8F /* PGPKeySettingTableViewController.swift */, - DCAAF7441E2FA66800AB94BC /* SettingsTableViewController.swift */, DC8963BF1E38EEB900828B09 /* SSHKeySettingTableViewController.swift */, DC917BDD1E2E8231000FDF54 /* Assets.xcassets */, DCDDEAAF1E4639F300F68193 /* LabelTableViewCell.xib */, diff --git a/pass/SettingsTableViewController.swift b/pass/SettingsTableViewController.swift index 6308faa..f5edb8f 100644 --- a/pass/SettingsTableViewController.swift +++ b/pass/SettingsTableViewController.swift @@ -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) }