|
@ -5,8 +5,8 @@ |
|
|
// Created by William Casarin on 2022-06-09. |
|
|
// Created by William Casarin on 2022-06-09. |
|
|
// |
|
|
// |
|
|
|
|
|
|
|
|
import SwiftUI |
|
|
|
|
|
import AVFoundation |
|
|
import AVFoundation |
|
|
|
|
|
import SwiftUI |
|
|
|
|
|
|
|
|
struct ConfigView: View { |
|
|
struct ConfigView: View { |
|
|
let state: DamusState |
|
|
let state: DamusState |
|
@ -14,6 +14,7 @@ struct ConfigView: View { |
|
|
@State var show_add_relay: Bool = false |
|
|
@State var show_add_relay: Bool = false |
|
|
@State var confirm_logout: Bool = false |
|
|
@State var confirm_logout: Bool = false |
|
|
@State var new_relay: String = "" |
|
|
@State var new_relay: String = "" |
|
|
|
|
|
@State var isHidden: Bool = true |
|
|
|
|
|
|
|
|
var body: some View { |
|
|
var body: some View { |
|
|
ZStack(alignment: .leading) { |
|
|
ZStack(alignment: .leading) { |
|
@ -25,7 +26,6 @@ struct ConfigView: View { |
|
|
RelayView(state: state, ev: ev, relay: relay) |
|
|
RelayView(state: state, ev: ev, relay: relay) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -37,15 +37,25 @@ struct ConfigView: View { |
|
|
AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate)) |
|
|
AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate)) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if let sec = state.keypair.privkey_bech32 { |
|
|
if let sec = state.keypair.privkey_bech32 { |
|
|
Section("Secret Account Login Key") { |
|
|
Section("Secret Account Login Key") { |
|
|
Text(sec) |
|
|
if isHidden == false { |
|
|
.textSelection(.enabled) |
|
|
Text(sec) |
|
|
.onTapGesture { |
|
|
.textSelection(.enabled) |
|
|
UIPasteboard.general.string = sec |
|
|
.onTapGesture { |
|
|
AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate)) |
|
|
UIPasteboard.general.string = sec |
|
|
} |
|
|
AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate)) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if isHidden == true { |
|
|
|
|
|
Text("*******") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Button("Show/Hide Key") { |
|
|
|
|
|
isHidden.toggle() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|