Allow existing GPG keys with cloned stores
This commit is contained in:
@@ -1927,7 +1927,7 @@ private final class KeyImportScannerViewController: UIViewController,
|
||||
: "Import this public key?"
|
||||
let alert = UIAlertController(
|
||||
title: localSetup
|
||||
? "Create Local Store with This Key?"
|
||||
? "Use This GPG Key?"
|
||||
: (privateKey ? "Import Private GPG Key?" : "Import Public GPG Key?"),
|
||||
message: "\(warning)\n\n\(key.title)\n\(key.detail)",
|
||||
preferredStyle: .alert
|
||||
@@ -1952,6 +1952,15 @@ private final class KeyImportScannerViewController: UIViewController,
|
||||
)
|
||||
})
|
||||
}
|
||||
if localSetup && privateKey {
|
||||
alert.addAction(UIAlertAction(title: "Use with Existing Store", style: .default) {
|
||||
[weak self, weak alert] _ in
|
||||
self?.finishImport(
|
||||
passphrase: alert?.textFields?.first?.text,
|
||||
makeDefault: false
|
||||
)
|
||||
})
|
||||
}
|
||||
if privateKey {
|
||||
alert.addAction(UIAlertAction(
|
||||
title: localSetup ? "Create Local Store" : "Import as Default",
|
||||
@@ -6290,7 +6299,7 @@ private final class SetupChoiceViewController: UITableViewController {
|
||||
case (0, 1):
|
||||
content.image = UIImage(systemName: "qrcode.viewfinder")
|
||||
content.text = "Import Local GPG Key"
|
||||
content.secondaryText = "Scan a private IronStorage key transfer"
|
||||
content.secondaryText = "Use a private key with a new or existing store"
|
||||
default:
|
||||
content.image = UIImage(systemName: "network")
|
||||
content.text = "Connect Existing Store"
|
||||
@@ -6796,15 +6805,11 @@ private final class OnboardingViewController: UITableViewController {
|
||||
case let .success(.completed(outcome)):
|
||||
tokenField.text = nil
|
||||
let alert = UIAlertController(title: outcome.title, message: outcome.detail, preferredStyle: .alert)
|
||||
alert.addAction(UIAlertAction(title: "Done", style: .default) { [weak self] _ in
|
||||
if self?.attachLocalStore == true {
|
||||
NotificationCenter.default.post(
|
||||
name: .ironStorageConfigurationDidChange,
|
||||
object: nil
|
||||
)
|
||||
} else {
|
||||
self?.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
alert.addAction(UIAlertAction(title: "Done", style: .default) { _ in
|
||||
NotificationCenter.default.post(
|
||||
name: .ironStorageConfigurationDidChange,
|
||||
object: nil
|
||||
)
|
||||
})
|
||||
present(alert, animated: true)
|
||||
case let .failure(failure):
|
||||
|
||||
Reference in New Issue
Block a user