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,
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(
noteEvent.quote(),
noteEvent.author(),
noteEvent.inUrl(),
quote,
author,
url,
makeItShort,
canPreview,
backgroundColor,