From be31028623aab51915c509fa4e05f16f0b0f804c Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Thu, 12 Dec 2024 10:56:05 +0100 Subject: [PATCH] Minor fixes --- .../net/mullvad/mullvadvpn/ui/MainActivity.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt index 99fafcab4377..4007b09ecd1f 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/MainActivity.kt @@ -13,6 +13,7 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import arrow.core.merge +import co.touchlab.kermit.Logger import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.filter @@ -131,12 +132,13 @@ class MainActivity : ComponentActivity(), AndroidScopeComponent { } private fun handleIntent(intent: Intent) { - if (intent.action == KEY_REQUEST_VPN_PROFILE) { - handleRequestVpnProfileIntent() - } else { - apiEndpointFromIntentHolder.setApiEndpointOverride( - intent.getApiEndpointConfigurationExtras() - ) + when (val action = intent.action) { + Intent.ACTION_MAIN -> + apiEndpointFromIntentHolder.setApiEndpointOverride( + intent.getApiEndpointConfigurationExtras() + ) + KEY_REQUEST_VPN_PROFILE -> handleRequestVpnProfileIntent() + else -> Logger.w("Unhandled intent action: $action") } }