Skip to content

Commit

Permalink
Small android style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Dec 14, 2023
1 parent 398e8c4 commit e01260b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ConnectViewModel(
notifications,
tunnelUiState,
tunnelRealState,
lastKnownLocation,
lastKnownDisconnectedLocation,
accountExpiry,
deviceName ->
if (tunnelRealState.isTunnelErrorStateDueToExpiredAccount()) {
Expand All @@ -93,11 +93,11 @@ class ConnectViewModel(
location =
when (tunnelRealState) {
is TunnelState.Disconnected -> tunnelRealState.location()
?: lastKnownLocation
?: lastKnownDisconnectedLocation
is TunnelState.Connecting -> tunnelRealState.location
is TunnelState.Connected -> tunnelRealState.location
is TunnelState.Disconnecting -> lastKnownLocation
is TunnelState.Error -> lastKnownLocation
is TunnelState.Disconnecting -> lastKnownDisconnectedLocation
is TunnelState.Error -> lastKnownDisconnectedLocation
},
relayLocation = relayLocation,
tunnelUiState = tunnelUiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ sealed class TunnelState : Parcelable {

fun location(): GeoIpLocation? {
return when (this) {
is Connected -> this.location
is Connecting -> this.location
is Connected -> location
is Connecting -> location
is Disconnecting -> null
is Disconnected -> this.location
is Disconnected -> location
is Error -> null
}
}
Expand Down

0 comments on commit e01260b

Please sign in to comment.