Observes the user's follow list and not the local account state to update TagLists on the screen

This commit is contained in:
Vitor Pamplona
2023-08-12 21:37:31 -04:00
parent 547d567431
commit 6f19bccc54

View File

@@ -2876,12 +2876,12 @@ fun DisplayFollowingHashtagsInPost(
) {
val noteEvent = remember { baseNote.event } ?: return
val accountState by accountViewModel.accountLiveData.observeAsState()
val userFollowState by accountViewModel.userFollows.observeAsState()
var firstTag by remember { mutableStateOf<String?>(null) }
LaunchedEffect(key1 = accountState) {
LaunchedEffect(key1 = userFollowState) {
launch(Dispatchers.Default) {
val followingTags = accountState?.account?.followingTagSet() ?: emptySet()
val followingTags = userFollowState?.user?.cachedFollowingTagSet() ?: emptySet()
val newFirstTag = noteEvent.firstIsTaggedHashes(followingTags)
if (firstTag != newFirstTag) {