Fixes lack of update in follow count on the UserProfile page
This commit is contained in:
+3
-6
@@ -249,15 +249,12 @@ fun observeUserFollowCount(
|
||||
remember(user) {
|
||||
user
|
||||
.flow()
|
||||
.followers.stateFlow
|
||||
.sample(200)
|
||||
.mapLatest { userState ->
|
||||
userState.user.transientFollowCount() ?: 0
|
||||
}.distinctUntilChanged()
|
||||
.follows.stateFlow
|
||||
.mapLatest { it.user.transientFollowCount() ?: 0 }
|
||||
.flowOn(Dispatchers.IO)
|
||||
}
|
||||
|
||||
return flow.collectAsStateWithLifecycle(0)
|
||||
return flow.collectAsStateWithLifecycle(user.transientFollowCount() ?: 0)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class, FlowPreview::class)
|
||||
|
||||
Reference in New Issue
Block a user