summaryrefslogtreecommitdiffhomepage
path: root/ios
diff options
context:
space:
mode:
authorAndrew Bulhak <andrew.bulhak@mullvad.net>2025-03-13 14:43:57 +0100
committerBug Magnet <marco.nikic@mullvad.net>2025-03-17 13:23:27 +0100
commitafe0d569f7e53c338aba50d7aff04f4591b3532e (patch)
tree81663e6862995f5d040cc370c875294eaf2f272b /ios
parentfd7ea9b6d85da82cb4d0c98435a9ec9f3e8d985d (diff)
downloadmullvadvpn-afe0d569f7e53c338aba50d7aff04f4591b3532e.tar.xz
mullvadvpn-afe0d569f7e53c338aba50d7aff04f4591b3532e.zip
Make Multihop feature chip appear if settings or current state say so
Diffstat (limited to 'ios')
-rw-r--r--ios/MullvadVPN/TunnelManager/TunnelState.swift4
-rw-r--r--ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ChipView/ChipFeature.swift3
-rw-r--r--ios/MullvadVPN/View controllers/Tunnel/ConnectionView/FeatureIndicatorsViewModel.swift2
3 files changed, 7 insertions, 2 deletions
diff --git a/ios/MullvadVPN/TunnelManager/TunnelState.swift b/ios/MullvadVPN/TunnelManager/TunnelState.swift
index 87f05e9f7c..41702065a1 100644
--- a/ios/MullvadVPN/TunnelManager/TunnelState.swift
+++ b/ios/MullvadVPN/TunnelManager/TunnelState.swift
@@ -145,6 +145,10 @@ enum TunnelState: Equatable, CustomStringConvertible, Sendable {
nil
}
}
+
+ var isMultihop: Bool {
+ relays?.entry != nil
+ }
}
/// A enum that describes the action to perform after disconnect.
diff --git a/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ChipView/ChipFeature.swift b/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ChipView/ChipFeature.swift
index 73bc01f8ab..71b864bc85 100644
--- a/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ChipView/ChipFeature.swift
+++ b/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ChipView/ChipFeature.swift
@@ -52,8 +52,9 @@ struct QuantumResistanceFeature: ChipFeature {
struct MultihopFeature: ChipFeature {
let settings: LatestTunnelSettings
+ let state: TunnelState
var isEnabled: Bool {
- settings.tunnelMultihopState.isEnabled
+ settings.tunnelMultihopState.isEnabled || state.isMultihop
}
var name: String {
diff --git a/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/FeatureIndicatorsViewModel.swift b/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/FeatureIndicatorsViewModel.swift
index d07ee2c69e..39a18c987a 100644
--- a/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/FeatureIndicatorsViewModel.swift
+++ b/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/FeatureIndicatorsViewModel.swift
@@ -29,7 +29,7 @@ class FeatureIndicatorsViewModel: ChipViewModelProtocol {
let features: [ChipFeature] = [
DaitaFeature(settings: tunnelSettings),
QuantumResistanceFeature(settings: tunnelSettings),
- MultihopFeature(settings: tunnelSettings),
+ MultihopFeature(settings: tunnelSettings, state: tunnelState),
ObfuscationFeature(settings: tunnelSettings),
DNSFeature(settings: tunnelSettings),
IPOverrideFeature(overrides: ipOverrides),