summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2024-02-07 23:34:07 +0100
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2024-02-08 10:50:58 +0100
commit1884feac95427a342e3e85f1ddfaf90efd654f5e (patch)
treec485196f3c63a3faa5d46433f71461b029561191 /android
parent8baf83c9ca8ffab6f7b103c001042dae1d701c9e (diff)
downloadmullvadvpn-1884feac95427a342e3e85f1ddfaf90efd654f5e.tar.xz
mullvadvpn-1884feac95427a342e3e85f1ddfaf90efd654f5e.zip
Support new relay item in connect screen
Diffstat (limited to 'android')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt4
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/ConnectUiState.kt4
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt6
3 files changed, 7 insertions, 7 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt
index f626191b4c..84d2a0418e 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt
@@ -264,8 +264,8 @@ fun ConnectScreen(
onClick = onSwitchLocationClick,
showChevron = uiState.showLocation,
text =
- if (uiState.showLocation) {
- uiState.relayLocation?.locationName ?: ""
+ if (uiState.showLocation && uiState.selectedRelayItem != null) {
+ uiState.selectedRelayItem.locationName
} else {
stringResource(id = R.string.switch_location)
}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/ConnectUiState.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/ConnectUiState.kt
index dc26e24741..988ae914e9 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/ConnectUiState.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/ConnectUiState.kt
@@ -8,7 +8,7 @@ import net.mullvad.talpid.net.TransportProtocol
data class ConnectUiState(
val location: GeoIpLocation?,
- val relayLocation: RelayItem?,
+ val selectedRelayItem: RelayItem?,
val tunnelUiState: TunnelState,
val tunnelRealState: TunnelState,
val inAddress: Triple<String, Int, TransportProtocol>?,
@@ -23,7 +23,7 @@ data class ConnectUiState(
val INITIAL =
ConnectUiState(
location = null,
- relayLocation = null,
+ selectedRelayItem = null,
tunnelUiState = TunnelState.Disconnected(),
tunnelRealState = TunnelState.Disconnected(),
inAddress = null,
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt
index 9b5a6c1e00..bee5b1ad00 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt
@@ -84,7 +84,7 @@ class ConnectViewModel(
accountRepository.accountExpiryState,
deviceRepository.deviceState.map { it.deviceName() }
) {
- relayLocation,
+ selectedRelayItem,
notifications,
tunnelUiState,
tunnelRealState,
@@ -97,12 +97,12 @@ class ConnectViewModel(
is TunnelState.Disconnected ->
tunnelRealState.location() ?: lastKnownDisconnectedLocation
is TunnelState.Connecting ->
- tunnelRealState.location ?: relayLocation?.location?.location
+ tunnelRealState.location ?: selectedRelayItem?.location()
is TunnelState.Connected -> tunnelRealState.location
is TunnelState.Disconnecting -> lastKnownDisconnectedLocation
is TunnelState.Error -> null
},
- relayLocation = relayLocation,
+ selectedRelayItem = selectedRelayItem,
tunnelUiState = tunnelUiState,
tunnelRealState = tunnelRealState,
inAddress =