mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-29 11:53:35 +00:00
SimpleX names v2: Android, desktop and iOS UIs
The names hub and the buy / gift / receive / renew / recovery-key flows across the Kotlin multiplatform app and the iOS Swift app. Stacked on the core PR. iOS is written but unbuilt: it needs a Mac build (no iOS job in CI) and a core lib rebuilt from the new simplexmq pin; expect MsgContent.assetTransfer exhaustiveness one-liners and a few accessor fixes on first xcodebuild.
This commit is contained in:
1 parent
dd0dcbf2bc
commit
31cd2619da
34 files changed
+2970
-7
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import SwiftUI
|
||||
import SimpleXChat
|
||||
|
||||
// How this profile gets its recovery key, asked once. Sharing the key across
|
||||
// profiles is the default because it means one thing to write down. A separate
|
||||
// key exists for a profile kept deliberately apart.
|
||||
struct WalletSetupView: View {
|
||||
@Environment(\.dismiss) var dismiss
|
||||
let hasOtherSeed: Bool
|
||||
@State private var busy = false
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
Section {
|
||||
if hasOtherSeed {
|
||||
Button { setup("existing") } label: { Label("Use the recovery key I already have", systemImage: "checkmark").foregroundColor(.accentColor) }
|
||||
}
|
||||
Button { setup("new") } label: {
|
||||
Label(hasOtherSeed ? "Give this profile its own recovery key" : "Create a recovery key", systemImage: "plus").foregroundColor(.accentColor)
|
||||
}
|
||||
NavigationLink { ImportRecoveryKeyView() } label: { Label("Restore names from a recovery key", systemImage: "square.and.arrow.down") }
|
||||
} footer: {
|
||||
Text(hasOtherSeed
|
||||
? "Using the key you already have means one set of words to write down, and it covers every profile. A separate key keeps this profile's names unconnected to your others, but is a second thing to keep safe."
|
||||
: "You will be shown the key afterwards. Write it down — it is the only way to get your names back if you lose this device.")
|
||||
}
|
||||
}
|
||||
.navigationTitle("Set up names for this profile")
|
||||
}
|
||||
|
||||
private func setup(_ arg: String) {
|
||||
Task { busy = true; defer { busy = false }; if await apiNameSetup(arg) { await MainActor.run { dismiss() } } }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user