Skip to content

Commit

Permalink
Fix divider not being completely hidden when applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
rablador committed Jan 7, 2025
1 parent 712d19e commit da9d9fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ extension ConnectionViewViewModel {
var showConnectionDetails: Bool {
switch tunnelStatus.state {
case .connecting, .reconnecting, .waitingForConnectivity(.noConnection), .negotiatingEphemeralPeer,
.connected, .pendingReconnect, .waitingForConnectivity(.noNetwork):
.connected, .pendingReconnect:
true
case .disconnecting, .disconnected, .error:
case .disconnecting, .disconnected, .waitingForConnectivity(.noNetwork), .error:
false
}
}
Expand Down Expand Up @@ -130,9 +130,9 @@ extension ConnectionViewViewModel {

var localizedTitleForSelectLocationButton: LocalizedStringKey {
switch tunnelStatus.state {
case .disconnecting, .pendingReconnect, .disconnected:
case .disconnecting, .pendingReconnect, .disconnected, ..waitingForConnectivity(.noNetwork):

Check failure on line 133 in ios/MullvadVPN/View controllers/Tunnel/FeatureIndicators/ConnectionView/ConnectionViewViewModel.swift

View workflow job for this annotation

GitHub Actions / Unit tests

cannot find operator '..' in scope; did you mean '...'?

Check failure on line 133 in ios/MullvadVPN/View controllers/Tunnel/FeatureIndicators/ConnectionView/ConnectionViewViewModel.swift

View workflow job for this annotation

GitHub Actions / Unit tests

cannot find 'waitingForConnectivity' in scope

Check failure on line 133 in ios/MullvadVPN/View controllers/Tunnel/FeatureIndicators/ConnectionView/ConnectionViewViewModel.swift

View workflow job for this annotation

GitHub Actions / Unit tests

cannot infer contextual base in reference to member 'noNetwork'
LocalizedStringKey("Select location")
case .connecting, .connected, .reconnecting, .waitingForConnectivity, .negotiatingEphemeralPeer, .error:
case .connecting, .connected, .reconnecting, .waitingForConnectivity(.noConnection), .negotiatingEphemeralPeer, .error:
LocalizedStringKey("Switch location")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ extension ConnectionView {
@State private var scrollViewHeight: CGFloat = 0

var body: some View {
// if isExpanded {
Divider()
.background(UIColor.secondaryTextColor.color)
.opacity(isExpanded ? 1.0 : 0.0)
// }
if isExpanded {
Divider()
.background(UIColor.secondaryTextColor.color)
}

// This geometry reader is somewhat of a workaround. It's "smart" in that it takes up as much
// space as it can and thereby helps the view to understand the maximum allowed height when
Expand Down

0 comments on commit da9d9fa

Please sign in to comment.