Allow existing GPG keys with cloned stores

This commit is contained in:
2026-08-17 17:00:31 +02:00
parent 0b7c938b23
commit a8a59d496b
3 changed files with 252 additions and 40 deletions

View File

@@ -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):