mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-30 18:12:32 +02:00
Fixes reply count
This commit is contained in:
@@ -176,9 +176,9 @@ fun observeNoteReplyCount(
|
||||
remember(note) {
|
||||
note
|
||||
.flow()
|
||||
.reactions.stateFlow
|
||||
.replies.stateFlow
|
||||
.sample(200)
|
||||
.mapLatest { it.note.replies.size }
|
||||
.sample(1000)
|
||||
.distinctUntilChanged()
|
||||
}
|
||||
|
||||
@@ -215,8 +215,8 @@ fun observeNoteReactionCount(
|
||||
note
|
||||
.flow()
|
||||
.reactions.stateFlow
|
||||
.sample(200)
|
||||
.mapLatest { it.note.countReactions() }
|
||||
.sample(1000)
|
||||
.distinctUntilChanged()
|
||||
.flowOn(Dispatchers.Default)
|
||||
}
|
||||
@@ -294,7 +294,7 @@ fun observeNoteRepostCount(
|
||||
note
|
||||
.flow()
|
||||
.boosts.stateFlow
|
||||
.sample(1000)
|
||||
.sample(200)
|
||||
.mapLatest { note.boosts.size }
|
||||
.distinctUntilChanged()
|
||||
}
|
||||
|
@@ -249,7 +249,7 @@ fun observeUserFollowCount(
|
||||
user
|
||||
.flow()
|
||||
.followers.stateFlow
|
||||
.sample(1000)
|
||||
.sample(200)
|
||||
.mapLatest { userState ->
|
||||
userState.user.transientFollowCount() ?: 0
|
||||
}.distinctUntilChanged()
|
||||
@@ -303,7 +303,7 @@ fun observeUserTagFollows(
|
||||
.hashtagFollows(user)
|
||||
.flow()
|
||||
.metadata.stateFlow
|
||||
.sample(1000)
|
||||
.sample(200)
|
||||
.mapLatest { noteState ->
|
||||
(noteState.note.event as? HashtagListEvent)?.publicAndCachedPrivateHashtags()?.sorted() ?: emptyList()
|
||||
}.onStart {
|
||||
@@ -345,7 +345,7 @@ fun observeUserBookmarkCount(
|
||||
user
|
||||
.flow()
|
||||
.followers.stateFlow
|
||||
.sample(1000)
|
||||
.sample(200)
|
||||
.mapLatest { userState ->
|
||||
userState.user.latestBookmarkList?.countBookmarks() ?: 0
|
||||
}.distinctUntilChanged()
|
||||
@@ -385,7 +385,7 @@ fun observeUserFollowerCount(
|
||||
user
|
||||
.flow()
|
||||
.followers.stateFlow
|
||||
.sample(1000)
|
||||
.sample(200)
|
||||
.mapLatest { userState ->
|
||||
userState.user.transientFollowerCount()
|
||||
}.distinctUntilChanged()
|
||||
|
Reference in New Issue
Block a user