android, desktop: enable reactions 😂 and

This commit is contained in:
Evgeny Poberezkin 2025-04-16 19:21:42 +01:00
parent 0f3e546e36
commit 82f9fecccf
No known key found for this signature in database
GPG key ID: 494BDDD9A28B577D
2 changed files with 7 additions and 5 deletions

View file

@ -3336,14 +3336,16 @@ sealed class MsgReaction {
}
companion object {
val values: List<MsgReaction> get() = MREmojiChar.values().map(::Emoji)
val old: List<MsgReaction> get() = listOf(
val values: List<MsgReaction> get() = MREmojiChar.entries.map(::Emoji)
val supported: List<MsgReaction> get() = listOf(
MREmojiChar.ThumbsUp,
MREmojiChar.ThumbsDown,
MREmojiChar.Smile,
MREmojiChar.Laugh,
MREmojiChar.Sad,
MREmojiChar.Heart,
MREmojiChar.Launch
MREmojiChar.Launch,
MREmojiChar.Check
).map(::Emoji)
}
}

View file

@ -337,7 +337,7 @@ fun ChatItemView(
@Composable
fun MsgReactionsMenu() {
val rs = MsgReaction.old.mapNotNull { r ->
val rs = MsgReaction.supported.mapNotNull { r ->
if (null == cItem.reactions.find { it.userReacted && it.reaction.text == r.text }) {
r
} else {
@ -348,7 +348,7 @@ fun ChatItemView(
Row(modifier = Modifier.padding(horizontal = DEFAULT_PADDING).horizontalScroll(rememberScrollState()), verticalAlignment = Alignment.CenterVertically) {
rs.forEach() { r ->
Box(
Modifier.size(36.dp).clickable {
Modifier.size(36.dp).clip(CircleShape).clickable {
setReaction(cInfo, cItem, true, r)
showMenu.value = false
},