Files
hope-voice-api/Sources/Features/Settings/SettingsView.swift
T
snowspeeder 378b8cb36f feat: server config, token client, TLS pinning, connection test (Phase 1)
ServerConfig parses https base URL and derives wss livekit URL;
TokenClient POSTs /token with clean 503/offline error states;
TLSPinning holds optional cert SHA-384 pins (empty = system trust);
Settings gains a Connection test screen proving the endpoint works.
2026-08-29 17:18:38 -04:00

34 lines
971 B
Swift

import SwiftUI
struct SettingsView: View {
@ObservedObject var settings: SettingsStore
@State private var urlText: String = ""
var body: some View {
Form {
Section("Server") {
TextField("https://192.168.86.2:9178", text: $urlText)
.keyboardType(.URL)
.autocorrectionDisabled()
.onAppear { urlText = settings.serverURL }
.onChange(of: urlText) { _, newValue in
settings.serverURL = newValue
}
}
Section("Interaction") {
Toggle("Text mode", isOn: $settings.textMode)
}
Section {
NavigationLink("Connection test") {
ConnectionTestView(settings: settings)
}
}
}
.navigationTitle("Settings")
}
}
#Preview {
SettingsView(settings: SettingsStore())
}