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