Update macOS

This commit is contained in:
Balazs Perlaki-Horvath 2025-08-02 22:08:57 +02:00
parent f824a6bc1a
commit bfb49f18b0
2 changed files with 10 additions and 7 deletions

View File

@ -42,19 +42,22 @@ struct HotspotDetails: View {
} }
.collapsible(false) .collapsible(false)
if case .started(let address, let qrCodeImage) = hotspot.state { switch hotspot.state {
case .started(let address, let qrCodeImage):
HotspotAddress(serverAddress: address, qrCodeImage: qrCodeImage) HotspotAddress(serverAddress: address, qrCodeImage: qrCodeImage)
} HotspotExplanation()
if let errorMessage = hotspot.errorMessage { case .stopped:
HotspotExplanation()
case .error(let errorMessage):
Section { Section {
Text(errorMessage) Text(errorMessage)
.fontWeight(.bold)
.lineLimit(nil) .lineLimit(nil)
.multilineTextAlignment(.leading) .multilineTextAlignment(.leading)
.foregroundStyle(.red) .foregroundStyle(.red)
} }
HotspotExplanation()
} }
HotspotExplanation()
} }
.listStyle(.sidebar) .listStyle(.sidebar)
} }

View File

@ -132,10 +132,10 @@ struct HotspotSettings: View {
var body: some View { var body: some View {
VStack(spacing: 16) { VStack(spacing: 16) {
SettingSection(name: LocalString.hotspot_settings_port_number) { SettingSection(name: LocalString.hotspot_settings_port_number) {
Text(Hotspot.validPortRangeMessage())
.foregroundColor(.secondary)
TextField("", value: $portNumber, formatter: PortNumberFormatter.instance) TextField("", value: $portNumber, formatter: PortNumberFormatter.instance)
.textFieldStyle(.roundedBorder) .textFieldStyle(.roundedBorder)
Text(Hotspot.validPortRangeMessage())
.foregroundColor(.secondary)
} }
.onChange(of: portNumber) { newValue in .onChange(of: portNumber) { newValue in
let fixedValue = Hotspot.fixedUp(port: newValue) let fixedValue = Hotspot.fixedUp(port: newValue)