From 6c3d27a09822026db185bf784e8746500c0fee2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20G=C3=B6ransson?= Date: Mon, 25 Nov 2024 20:20:19 +0100 Subject: [PATCH] Fix detekt warning --- .../mullvad/mullvadvpn/compose/screen/ConnectScreen.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 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 3a91b144042d..0a2edd8f4f42 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 @@ -154,9 +154,8 @@ fun Connect( minActiveState = Lifecycle.State.RESUMED, ) { sideEffect -> when (sideEffect) { - is ConnectViewModel.UiSideEffect.OpenAccountManagementPageInBrowser -> { + is ConnectViewModel.UiSideEffect.OpenAccountManagementPageInBrowser -> openAccountPage(sideEffect.token) - } is ConnectViewModel.UiSideEffect.OutOfTime -> navigator.navigate(OutOfTimeDestination) { @@ -172,7 +171,8 @@ fun Connect( is ConnectViewModel.UiSideEffect.NotPrepared -> when (sideEffect.prepareError) { - is PrepareError.OtherLegacyAlwaysOnVpn -> launch { + is PrepareError.OtherLegacyAlwaysOnVpn -> + launch { snackbarHostState.showSnackbarImmediately( message = sideEffect.prepareError.toMessage(context) ) @@ -194,13 +194,12 @@ fun Connect( ) } - is ConnectViewModel.UiSideEffect.OpenUri -> { + is ConnectViewModel.UiSideEffect.OpenUri -> try { uriHandler.openUri(sideEffect.uri.toString()) } catch (e: IllegalArgumentException) { Logger.w("Failed to open uri", e) } - } } }