Skip to content

Commit e5332d1

Browse files
committed
ui: remove redundant toggle in listening address configuration screen
1 parent f2a5783 commit e5332d1

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Sushitrain/AddressesView.swift

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -375,19 +375,21 @@ struct AddressesView: View {
375375

376376
var body: some View {
377377
Form {
378-
Section {
379-
Toggle(
380-
"Use default addresses",
381-
isOn: Binding(get: { return self.useDefaultOption }, set: { self.setUseDefaultOption($0) }))
382-
} footer: {
383-
switch self.addressType {
384-
case .stun: Text("When enabled, the app will use the default STUN servers.")
385-
case .discovery: Text("When enabled, the app will use the default discovery service to announce itself.")
386-
case .listening:
387-
Text("When enabled, the app will listen on default addresses, and will use the default relay pool.")
388-
case .device:
389-
Text(
390-
"When enabled, the app will look up addresses for this device automatically using various discovery mechanisms.")
378+
if self.addressType != .listening {
379+
Section {
380+
Toggle(
381+
"Use default addresses",
382+
isOn: Binding(get: { return self.useDefaultOption }, set: { self.setUseDefaultOption($0) }))
383+
} footer: {
384+
switch self.addressType {
385+
case .stun: Text("When enabled, the app will use the default STUN servers.")
386+
case .discovery: Text("When enabled, the app will use the default discovery service to announce itself.")
387+
case .listening:
388+
Text("When enabled, the app will listen on default addresses, and will use the default relay pool.")
389+
case .device:
390+
Text(
391+
"When enabled, the app will look up addresses for this device automatically using various discovery mechanisms.")
392+
}
391393
}
392394
}
393395

0 commit comments

Comments
 (0)