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 f560ddfee97c..94b5ef3b5b85 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 @@ -153,13 +153,12 @@ fun Connect( popUpTo(NavGraphs.root) { inclusive = true } } is ConnectViewModel.UiSideEffect.NoVpnPermission -> launchVpnPermission.launch(Unit) - is ConnectViewModel.UiSideEffect.ConnectError -> { + is ConnectViewModel.UiSideEffect.ConnectError -> launch { snackbarHostState.showSnackbarImmediately( message = sideEffect.toMessage(context), ) } - } } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListsScreen.kt index 77b919a6d590..36e2ad5f4772 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/CustomListsScreen.kt @@ -74,7 +74,7 @@ fun CustomLists( NavResult.Canceled -> { /* Do nothing */ } - is NavResult.Value -> { + is NavResult.Value -> scope.launch { snackbarHostState.showSnackbarImmediately( message = @@ -87,7 +87,6 @@ fun CustomLists( onAction = { viewModel.undoDeleteCustomList(result.value.undo) } ) } - } } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt index 6c49613543da..eb87e0f06f5f 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt @@ -150,7 +150,7 @@ fun SelectLocation( LaunchedEffectCollect(vm.uiSideEffect) { when (it) { SelectLocationSideEffect.CloseScreen -> backNavigator.navigateBack(result = true, true) - is SelectLocationSideEffect.LocationAddedToCustomList -> { + is SelectLocationSideEffect.LocationAddedToCustomList -> launch { snackbarHostState.showResultSnackbar( context = context, @@ -158,8 +158,7 @@ fun SelectLocation( onUndo = vm::performAction ) } - } - is SelectLocationSideEffect.LocationRemovedFromCustomList -> { + is SelectLocationSideEffect.LocationRemovedFromCustomList -> launch { snackbarHostState.showResultSnackbar( context = context, @@ -167,15 +166,13 @@ fun SelectLocation( onUndo = vm::performAction ) } - } - SelectLocationSideEffect.GenericError -> { + SelectLocationSideEffect.GenericError -> launch { snackbarHostState.showSnackbarImmediately( message = context.getString(R.string.error_occurred), duration = SnackbarDuration.Short ) } - } } }