mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-06-19 07:10:56 +02:00
Slight improvement in the performance of Reaction Row's rendering
This commit is contained in:
parent
553bebb6cf
commit
2cc9bb8b72
@ -156,11 +156,14 @@ private fun InnerReactionRow(
|
|||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
modifier = ReactionRowExpandButton
|
modifier = ReactionRowExpandButton
|
||||||
) {
|
) {
|
||||||
Row(verticalAlignment = CenterVertically) {
|
val (value, elapsed) = measureTimedValue {
|
||||||
WatchReactionsZapsBoostsAndDisplayIfExists(baseNote) {
|
Row(verticalAlignment = CenterVertically) {
|
||||||
RenderShowIndividualReactionsButton(wantsToSeeReactions)
|
WatchReactionsZapsBoostsAndDisplayIfExists(baseNote) {
|
||||||
|
RenderShowIndividualReactionsButton(wantsToSeeReactions)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Log.d("Rendering Metrics", "Reactions Button: ${baseNote.event?.content()?.split("\n")?.getOrNull(0)?.take(15)}.. $elapsed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,10 +327,8 @@ private fun WatchReactionsZapsBoostsAndDisplayIfExists(baseNote: Note, content:
|
|||||||
baseNote.reactions.isNotEmpty()
|
baseNote.reactions.isNotEmpty()
|
||||||
)
|
)
|
||||||
|
|
||||||
Crossfade(targetState = hasReactions) {
|
if (hasReactions) {
|
||||||
if (it) {
|
content()
|
||||||
content()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user