summaryrefslogtreecommitdiffhomepage
path: root/android/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'android/app/src/main')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModel.kt13
1 files changed, 4 insertions, 9 deletions
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 e6256e2be6..bf3414b0e1 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
@@ -14,7 +14,6 @@ import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.flow.emptyFlow
-import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.shareIn
@@ -132,14 +131,10 @@ class ConnectViewModel(
.debounce(UI_STATE_DEBOUNCE_DURATION_MILLIS)
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(), ConnectUiState.INITIAL)
- private fun LocationInfoCache.locationCallbackFlow() =
- callbackFlow {
- onNewLocation = { this.trySend(it) }
- awaitClose { onNewLocation = null }
- }
- // Filter out empty or short-name country representations.
- // We want to keep null location to handle those situations
- .filter { it?.let { location -> location.country.length > 2 } ?: true }
+ private fun LocationInfoCache.locationCallbackFlow() = callbackFlow {
+ onNewLocation = { this.trySend(it) }
+ awaitClose { onNewLocation = null }
+ }
private fun RelayListListener.relayListCallbackFlow() = callbackFlow {
onRelayCountriesChange = { _, item -> this.trySend(item) }