improving the speed of the highlighter rendering
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user