@@ -232,7 +232,8 @@ final class ConnectionURLViewController: HAFormViewController, TypedRowControlle
232232 $0. tag = RowTag . internalURLWarning. rawValue
233233 if server. info. connection. internalSSIDs? . isEmpty ?? true ,
234234 server. info. connection. internalHardwareAddresses? . isEmpty ?? true ,
235- !server. info. connection. alwaysFallbackToInternalURL {
235+ !server. info. connection. alwaysFallbackToInternalURL,
236+ !ConnectionInfo. shouldFallbackToInternalURL {
236237 #if targetEnvironment(macCatalyst)
237238 $0. title = " ‼️ " + L10n. Settings. ConnectionSection. InternalBaseUrl. SsidBssidRequired. title
238239 #else
@@ -296,39 +297,41 @@ final class ConnectionURLViewController: HAFormViewController, TypedRowControlle
296297 }
297298 }
298299
299- form +++ Section ( footer: L10n . Settings. ConnectionSection. AlwaysFallbackInternal. footer)
300- <<< SwitchRow ( RowTag . alwaysFallbackToInternalURL. rawValue) {
301- $0. title = L10n . Settings. ConnectionSection. AlwaysFallbackInternal. title
302- $0. value = server. info. connection. alwaysFallbackToInternalURL
300+ if !ConnectionInfo. shouldFallbackToInternalURL {
301+ form +++ Section ( footer: L10n . Settings. ConnectionSection. AlwaysFallbackInternal. footer)
302+ <<< SwitchRow ( RowTag . alwaysFallbackToInternalURL. rawValue) {
303+ $0. title = L10n . Settings. ConnectionSection. AlwaysFallbackInternal. title
304+ $0. value = server. info. connection. alwaysFallbackToInternalURL
303305
304- $0. cellUpdate { cell, _ in
305- cell. switchControl. onTintColor = . red
306- }
306+ $0. cellUpdate { cell, _ in
307+ cell. switchControl. onTintColor = . red
308+ }
307309
308- $0. onChange { [ weak self] row in
309- if row. value ?? false {
310- let alert = UIAlertController (
311- title: L10n . Settings. ConnectionSection. AlwaysFallbackInternal. Confirmation. title,
312- message: L10n . Settings. ConnectionSection. AlwaysFallbackInternal. Confirmation. message,
313- preferredStyle: . alert
314- )
315- alert. addAction ( UIAlertAction ( title: L10n . cancelLabel, style: . cancel, handler: { _ in
316- self ? . server. info. connection. alwaysFallbackToInternalURL = false
317- row. value = false
318- row. cellUpdate { _, row in
310+ $0. onChange { [ weak self] row in
311+ if row. value ?? false {
312+ let alert = UIAlertController (
313+ title: L10n . Settings. ConnectionSection. AlwaysFallbackInternal. Confirmation. title,
314+ message: L10n . Settings. ConnectionSection. AlwaysFallbackInternal. Confirmation. message,
315+ preferredStyle: . alert
316+ )
317+ alert. addAction ( UIAlertAction ( title: L10n . cancelLabel, style: . cancel, handler: { _ in
318+ self ? . server. info. connection. alwaysFallbackToInternalURL = false
319319 row. value = false
320- }
321- row. reload ( )
322- } ) )
323- alert. addAction ( UIAlertAction (
324- title: L10n . Settings. ConnectionSection. AlwaysFallbackInternal. Confirmation
325- . confirmButton,
326- style: . destructive
327- ) )
328- self ? . present ( alert, animated: true )
320+ row. cellUpdate { _, row in
321+ row. value = false
322+ }
323+ row. reload ( )
324+ } ) )
325+ alert. addAction ( UIAlertAction (
326+ title: L10n . Settings. ConnectionSection. AlwaysFallbackInternal. Confirmation
327+ . confirmButton,
328+ style: . destructive
329+ ) )
330+ self ? . present ( alert, animated: true )
331+ }
329332 }
330333 }
331- }
334+ }
332335 }
333336
334337 private func locationPermissionSection( ) -> Section {
0 commit comments