Skip to content

Commit cdcd6c4

Browse files
committed
Make Multihop feature chip appear if settings or current state say so
1 parent 6192767 commit cdcd6c4

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

ios/MullvadVPN/TunnelManager/TunnelState.swift

+4
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ enum TunnelState: Equatable, CustomStringConvertible, Sendable {
145145
nil
146146
}
147147
}
148+
149+
var isMultihop: Bool {
150+
relays?.entry != nil
151+
}
148152
}
149153

150154
/// A enum that describes the action to perform after disconnect.

ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ChipView/ChipFeature.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ struct QuantumResistanceFeature: ChipFeature {
5252

5353
struct MultihopFeature: ChipFeature {
5454
let settings: LatestTunnelSettings
55+
let state: TunnelState
5556
var isEnabled: Bool {
56-
settings.tunnelMultihopState.isEnabled
57+
settings.tunnelMultihopState.isEnabled || state.isMultihop
5758
}
5859

5960
var name: String {

ios/MullvadVPN/View controllers/Tunnel/ConnectionView/FeatureIndicatorsViewModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class FeatureIndicatorsViewModel: ChipViewModelProtocol {
2929
let features: [ChipFeature] = [
3030
DaitaFeature(settings: tunnelSettings),
3131
QuantumResistanceFeature(settings: tunnelSettings),
32-
MultihopFeature(settings: tunnelSettings),
32+
MultihopFeature(settings: tunnelSettings, state: tunnelState),
3333
ObfuscationFeature(settings: tunnelSettings),
3434
DNSFeature(settings: tunnelSettings),
3535
IPOverrideFeature(overrides: ipOverrides),

0 commit comments

Comments
 (0)