Skip to content

Commit

Permalink
fix: crash on code screen while requesting focus (WPB-6876) (#3043)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina authored May 28, 2024
1 parent 40ebea4 commit 0fee9fe
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import com.wire.android.ui.common.scaffold.WireScaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -58,6 +57,7 @@ import com.wire.android.ui.common.WireDialog
import com.wire.android.ui.common.WireDialogButtonProperties
import com.wire.android.ui.common.WireDialogButtonType
import com.wire.android.ui.common.progress.WireCircularProgressIndicator
import com.wire.android.ui.common.scaffold.WireScaffold
import com.wire.android.ui.common.textfield.CodeFieldValue
import com.wire.android.ui.common.textfield.CodeTextField
import com.wire.android.ui.common.textfield.WireTextFieldState
Expand All @@ -70,6 +70,7 @@ import com.wire.android.ui.theme.wireTypography
import com.wire.android.util.DialogErrorStrings
import com.wire.android.util.dialogErrorStrings
import com.wire.kalium.logic.configuration.server.ServerConfig
import kotlinx.coroutines.job

@CreatePersonalAccountNavGraph
@CreateTeamAccountNavGraph
Expand Down Expand Up @@ -174,8 +175,10 @@ private fun CodeContent(
}
}
LaunchedEffect(Unit) {
focusRequester.requestFocus()
keyboardController?.show()
coroutineContext.job.invokeOnCompletion {
focusRequester.requestFocus()
keyboardController?.show()
}
}
if (state.error is CreateAccountCodeViewState.CodeError.DialogError) {
val (title, message) = state.error.getResources(type = state.type)
Expand Down

0 comments on commit 0fee9fe

Please sign in to comment.