diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableRoute.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableRoute.kt index af2fce9364..9bcfbe5bdb 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableRoute.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableRoute.kt @@ -304,20 +304,20 @@ fun CreateClickableText( val primaryColor = MaterialTheme.colorScheme.primary val onBackgroundColor = MaterialTheme.colorScheme.onBackground - val clickablePartStyle = - SpanStyle( - color = overrideColor ?: primaryColor, - fontWeight = fontWeight, - ) - - val nonClickablePartStyle = - SpanStyle( - color = overrideColor ?: onBackgroundColor, - fontWeight = fontWeight, - ) - val text = - remember(clickablePartStyle, nonClickablePartStyle, clickablePart, suffix) { + remember(clickablePart, suffix) { + val clickablePartStyle = + SpanStyle( + color = overrideColor ?: primaryColor, + fontWeight = fontWeight, + ) + + val nonClickablePartStyle = + SpanStyle( + color = overrideColor ?: onBackgroundColor, + fontWeight = fontWeight, + ) + buildAnnotatedString { withStyle(clickablePartStyle) { append(clickablePart) } if (!suffix.isNullOrBlank()) {