diff --git a/Views/Hotspot/HotspotDetails.swift b/Views/Hotspot/HotspotDetails.swift index 4ad4a8fa..4232ff54 100644 --- a/Views/Hotspot/HotspotDetails.swift +++ b/Views/Hotspot/HotspotDetails.swift @@ -42,19 +42,22 @@ struct HotspotDetails: View { } .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) - } - if let errorMessage = hotspot.errorMessage { + HotspotExplanation() + case .stopped: + HotspotExplanation() + case .error(let errorMessage): Section { Text(errorMessage) - .fontWeight(.bold) .lineLimit(nil) .multilineTextAlignment(.leading) .foregroundStyle(.red) } + HotspotExplanation() } - HotspotExplanation() + } .listStyle(.sidebar) } diff --git a/Views/Settings/Settings.swift b/Views/Settings/Settings.swift index 606cd5a2..ab883174 100644 --- a/Views/Settings/Settings.swift +++ b/Views/Settings/Settings.swift @@ -132,10 +132,10 @@ struct HotspotSettings: View { var body: some View { VStack(spacing: 16) { SettingSection(name: LocalString.hotspot_settings_port_number) { - Text(Hotspot.validPortRangeMessage()) - .foregroundColor(.secondary) TextField("", value: $portNumber, formatter: PortNumberFormatter.instance) .textFieldStyle(.roundedBorder) + Text(Hotspot.validPortRangeMessage()) + .foregroundColor(.secondary) } .onChange(of: portNumber) { newValue in let fixedValue = Hotspot.fixedUp(port: newValue)