From 8d14713843ed548db2b688eda41d2c8cd57ee526 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:55:56 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20ensure=20request=20focus=20is=20called?= =?UTF-8?q?=20once=20after=20the=20first=20composition=20is=20done=20[WPB-?= =?UTF-8?q?10571]=20=F0=9F=8D=92=20(#3324)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mohamad Jaara Co-authored-by: Yamil Medina --- .../create/code/CreateAccountCodeScreen.kt | 10 +++++----- .../create/email/CreateAccountEmailScreen.kt | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/authentication/create/code/CreateAccountCodeScreen.kt b/app/src/main/kotlin/com/wire/android/ui/authentication/create/code/CreateAccountCodeScreen.kt index 680705d00ed..7e1ba6d68d4 100644 --- a/app/src/main/kotlin/com/wire/android/ui/authentication/create/code/CreateAccountCodeScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/authentication/create/code/CreateAccountCodeScreen.kt @@ -187,11 +187,11 @@ private fun CodeContent( } Spacer(modifier = Modifier.weight(1f)) } - } - LaunchedEffect(Unit) { - coroutineContext.job.invokeOnCompletion { - focusRequester.requestFocus() - keyboardController?.show() + LaunchedEffect(Unit) { + coroutineContext.job.invokeOnCompletion { + focusRequester.requestFocus() + keyboardController?.show() + } } } } diff --git a/app/src/main/kotlin/com/wire/android/ui/authentication/create/email/CreateAccountEmailScreen.kt b/app/src/main/kotlin/com/wire/android/ui/authentication/create/email/CreateAccountEmailScreen.kt index 7f14e85ad4f..a67bfc92854 100644 --- a/app/src/main/kotlin/com/wire/android/ui/authentication/create/email/CreateAccountEmailScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/authentication/create/email/CreateAccountEmailScreen.kt @@ -89,8 +89,8 @@ import com.wire.kalium.logic.configuration.server.ServerConfig @WireDestination(navArgsDelegate = CreateAccountNavArgs::class) @Composable fun CreateAccountEmailScreen( - createAccountEmailViewModel: CreateAccountEmailViewModel = hiltViewModel(), - navigator: Navigator + navigator: Navigator, + createAccountEmailViewModel: CreateAccountEmailViewModel = hiltViewModel() ) { with(createAccountEmailViewModel) { fun navigateToDetailsScreen() = navigator.navigate( @@ -185,6 +185,9 @@ private fun EmailContent( } Spacer(modifier = Modifier.weight(1f)) EmailFooter(state = state, onLoginPressed = onLoginPressed, onContinuePressed = onContinuePressed) + LaunchedEffect(Unit) { + focusRequester.requestFocus() + } } } if (state.termsDialogVisible) { @@ -198,9 +201,6 @@ private fun EmailContent( if (state.error is CreateAccountEmailViewState.EmailError.DialogError.GenericError) { CoreFailureErrorDialog(state.error.coreFailure, onErrorDismiss) } - LaunchedEffect(Unit) { - focusRequester.requestFocus() - } } @Composable