Set PGP key source once for all key importers

This commit is contained in:
Danny Moesch 2020-02-09 22:39:59 +01:00 committed by Mingshen Sun
parent e0c9ceb4fd
commit 43bba1fb50
4 changed files with 2 additions and 9 deletions

View file

@ -40,6 +40,7 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
SVProgressHUD.setDefaultStyle(.light)
SVProgressHUD.show(withStatus: "FetchingPgpKey".localize())
DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
Defaults.pgpKeySource = type(of: keyImporter).keySource
do {
try keyImporter.importKeys()
try PGPAgent.shared.initKeys()
@ -253,8 +254,6 @@ extension SettingsTableViewController: PGPKeyImporter {
}
func importKeys() throws {
Defaults.pgpKeySource = Self.keySource
try KeyFileManager.PublicPgp.importKeyFromFileSharing()
try KeyFileManager.PrivatePgp.importKeyFromFileSharing()
}