1
0
mirror of git://jb55.com/damus synced 2024-10-06 03:33:22 +00:00

loginview: functionality: removed the toggle for hex npub - NEEDS UPDATING

This commit is contained in:
ericholguin 2023-05-26 16:09:15 -06:00 committed by William Casarin
parent 46556c8bdc
commit f171cfffe7

View File

@ -70,11 +70,7 @@ struct LoginView: View {
let parsed = parse_key(key)
if parsed?.is_hex ?? false {
Text("This is an old-style nostr key. We're not sure if it's a pubkey or private key. Please toggle the button below if this a public key.", comment: "Warning that the inputted account key for login is an old-style and asking user to verify if it is a public key.")
.font(.subheadline.bold())
.foregroundColor(.white)
PubkeySwitch(isOn: $is_pubkey)
.padding()
// convert to bech32 here
}
if let error = get_error(parsed_key: parsed) {
@ -120,18 +116,6 @@ struct LoginView: View {
}
}
struct PubkeySwitch: View {
@Binding var isOn: Bool
var body: some View {
HStack {
Toggle(isOn: $isOn) {
Text("Public Key?", comment: "Prompt to ask user if the key they entered is a public key.")
.foregroundColor(.white)
}
}
}
}
func parse_key(_ thekey: String) -> ParsedKey? {
var key = thekey
if key.count > 0 && key.first! == "@" {