summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJon Petersson <jon.petersson@mullvad.net>2025-10-14 10:01:27 +0200
committerJon Petersson <jon.petersson@mullvad.net>2025-10-14 10:01:27 +0200
commitf42d910066eeacf5822e09a8a77dabd7f39f0beb (patch)
tree738e58026f7ed528952f86315d72af2dc2627ceb
parentd62196f87e43f2970a90825045800924bb28f2a5 (diff)
parentef38d775c90944cbdbe7e0a79676fe6af0069b29 (diff)
downloadmullvadvpn-f42d910066eeacf5822e09a8a77dabd7f39f0beb.tar.xz
mullvadvpn-f42d910066eeacf5822e09a8a77dabd7f39f0beb.zip
Merge branch 'direct-only-toggle-gives-the-same-warning-dialog-on-ios-1305'
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/DAITA/DAITATunnelSettingsViewModel.swift19
1 files changed, 8 insertions, 11 deletions
diff --git a/ios/MullvadVPN/Coordinators/Settings/DAITA/DAITATunnelSettingsViewModel.swift b/ios/MullvadVPN/Coordinators/Settings/DAITA/DAITATunnelSettingsViewModel.swift
index 072ea50e96..8b61c9c279 100644
--- a/ios/MullvadVPN/Coordinators/Settings/DAITA/DAITATunnelSettingsViewModel.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/DAITA/DAITATunnelSettingsViewModel.swift
@@ -92,19 +92,16 @@ extension DAITATunnelSettingsViewModel {
var compatibilityError: DAITASettingsCompatibilityError?
- do {
- _ = try tunnelManager.selectRelays(tunnelSettings: tunnelSettings)
- } catch let error as NoRelaysSatisfyingConstraintsError where error.reason == .noDaitaRelaysFound {
- // Return error if no relays could be selected due to DAITA constraints.
- compatibilityError = tunnelSettings.tunnelMultihopState.isEnabled ? .multihop : .singlehop
- } catch _ as NoRelaysSatisfyingConstraintsError {
- // Even if the constraints error is not DAITA specific, if both DAITA and Direct only are enabled,
- // we should return a DAITA related error since the current settings would have resulted in the
- // relay selector not being able to select a DAITA relay anyway.
- if settings.isDirectOnly {
+ if settings.isDirectOnly {
+ let relays = try? tunnelManager.selectRelays(tunnelSettings: tunnelSettings)
+
+ // Even if the reason for not finding any relays is not DAITA specific, if both DAITA and Direct
+ // only are enabled, we should return a DAITA related error since the current settings would have
+ // resulted in the relay selector not being able to select a DAITA relay anyway.
+ if relays == nil {
compatibilityError = tunnelSettings.tunnelMultihopState.isEnabled ? .multihop : .singlehop
}
- } catch {}
+ }
return compatibilityError
}