Moves tags calculation to Launched Effect

This commit is contained in:
Vitor Pamplona 2023-04-07 17:38:02 -04:00
parent c58b13e2f7
commit e6554a5b4a

View File

@ -566,11 +566,15 @@ fun DisplayFollowingHashtagsInPost(
account: Account,
navController: NavController
) {
var firstTag by remember { mutableStateOf<String?>(null) }
LaunchedEffect(key1 = noteEvent) {
firstTag = noteEvent.firstIsTaggedHashes(account.followingTagSet())
}
Column() {
Row(verticalAlignment = Alignment.CenterVertically) {
val firstTag =
noteEvent.firstIsTaggedHashes(account.followingTagSet())
if (firstTag != null) {
firstTag?.let {
ClickableText(
text = AnnotatedString(" #$firstTag"),
onClick = { navController.navigate("Hashtag/$firstTag") },