From 820def620c6b4c13d0e74a3ec9bb9f5c04fb673d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 30 Oct 2023 12:52:19 -0400 Subject: [PATCH] Improving rendering of reaction types --- .../amethyst/ui/note/ReactionsRow.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt index 86f91239e..71bfcfab4 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt @@ -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,