mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 03:43:36 +02:00
New Public Message screen: to field should get focus if it is empty, otherwise the message field should have the focus
This commit is contained in:
@@ -173,7 +173,7 @@ fun PublicMessageScreenContent(
|
|||||||
) {
|
) {
|
||||||
SendDirectMessageTo(postViewModel, accountViewModel)
|
SendDirectMessageTo(postViewModel, accountViewModel)
|
||||||
|
|
||||||
MessageFieldRow(postViewModel, accountViewModel)
|
MessageFieldRow(postViewModel, accountViewModel, postViewModel.toUsers.text.isNotBlank())
|
||||||
|
|
||||||
DisplayPreviews(postViewModel.urlPreviews, accountViewModel, nav)
|
DisplayPreviews(postViewModel.urlPreviews, accountViewModel, nav)
|
||||||
|
|
||||||
@@ -327,11 +327,13 @@ fun SendDirectMessageTo(
|
|||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
val keyboardController = LocalSoftwareKeyboardController.current
|
||||||
|
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
|
if (postViewModel.toUsers.text.isBlank()) {
|
||||||
launch {
|
launch {
|
||||||
delay(200)
|
delay(200)
|
||||||
focusRequester.requestFocus()
|
focusRequester.requestFocus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column(Modifier.fillMaxWidth()) {
|
Column(Modifier.fillMaxWidth()) {
|
||||||
Row(
|
Row(
|
||||||
|
Reference in New Issue
Block a user