Improving rendering of reaction types

This commit is contained in:
Vitor Pamplona 2023-10-30 12:52:19 -04:00
parent 9fef3e9e3e
commit 820def620c

View File

@ -821,13 +821,16 @@ private fun RenderReactionType(
iconSize: Dp = Size20dp,
iconFontSize: TextUnit
) {
if (reactionType.startsWith(":")) {
val noStartColon = reactionType.removePrefix(":")
val url = noStartColon.substringAfter(":")
val isCustom = remember(reactionType) {
reactionType.startsWith(":")
}
val renderable = listOf(
ImageUrlType(url)
).toImmutableList()
if (isCustom) {
val renderable = remember(reactionType) {
listOf(
ImageUrlType(reactionType.removePrefix(":").substringAfter(":"))
).toImmutableList()
}
InLineIconRenderer(
renderable,