multiplatform: reduce recompositions in ChatView while entering text (#2974)
This commit is contained in:
parent
7f894abbad
commit
bdc08698c8
@ -425,11 +425,12 @@ fun ChatLayout(
|
|||||||
onComposed: () -> Unit,
|
onComposed: () -> Unit,
|
||||||
) {
|
) {
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
|
val attachmentDisabled = remember { derivedStateOf { composeState.value.attachmentDisabled } }
|
||||||
Box(
|
Box(
|
||||||
Modifier
|
Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.desktopOnExternalDrag(
|
.desktopOnExternalDrag(
|
||||||
enabled = !composeState.value.attachmentDisabled && rememberUpdatedState(chat.userCanSend).value,
|
enabled = !attachmentDisabled.value && rememberUpdatedState(chat.userCanSend).value,
|
||||||
onFiles = { paths ->
|
onFiles = { paths ->
|
||||||
val uris = paths.map { URI.create(it) }
|
val uris = paths.map { URI.create(it) }
|
||||||
val groups = uris.groupBy { isImage(it) }
|
val groups = uris.groupBy { isImage(it) }
|
||||||
|
Loading…
Reference in New Issue
Block a user