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

pull/549/head
Vitor Pamplona 2023-08-12 21:37:31 -04:00
rodzic 547d567431
commit 6f19bccc54
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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) {