diff options
Diffstat (limited to 'android')
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 = |
