mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 20:26:33 +02:00
Observes the user's follow list and not the local account state to update TagLists on the screen
This commit is contained in:
@@ -2876,12 +2876,12 @@ fun DisplayFollowingHashtagsInPost(
|
|||||||
) {
|
) {
|
||||||
val noteEvent = remember { baseNote.event } ?: return
|
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) }
|
var firstTag by remember { mutableStateOf<String?>(null) }
|
||||||
|
|
||||||
LaunchedEffect(key1 = accountState) {
|
LaunchedEffect(key1 = userFollowState) {
|
||||||
launch(Dispatchers.Default) {
|
launch(Dispatchers.Default) {
|
||||||
val followingTags = accountState?.account?.followingTagSet() ?: emptySet()
|
val followingTags = userFollowState?.user?.cachedFollowingTagSet() ?: emptySet()
|
||||||
val newFirstTag = noteEvent.firstIsTaggedHashes(followingTags)
|
val newFirstTag = noteEvent.firstIsTaggedHashes(followingTags)
|
||||||
|
|
||||||
if (firstTag != newFirstTag) {
|
if (firstTag != newFirstTag) {
|
||||||
|
Reference in New Issue
Block a user