improving the speed of the highlighter rendering

This commit is contained in:
Vitor Pamplona
2023-06-09 11:27:27 -04:00
parent 5327e1ddb2
commit e3d83fe39a
@@ -970,12 +970,20 @@ private fun RenderHighlight(
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
nav: (String) -> Unit nav: (String) -> Unit
) { ) {
val noteEvent = note.event as? HighlightEvent ?: return val quote = remember {
(note.event as? HighlightEvent)?.quote() ?: ""
}
val author = remember() {
(note.event as? HighlightEvent)?.author()
}
val url = remember() {
(note.event as? HighlightEvent)?.inUrl()
}
DisplayHighlight( DisplayHighlight(
noteEvent.quote(), quote,
noteEvent.author(), author,
noteEvent.inUrl(), url,
makeItShort, makeItShort,
canPreview, canPreview,
backgroundColor, backgroundColor,