resets the show full text flag after 20 views.

This commit is contained in:
Vitor Pamplona
2024-03-06 15:02:59 -05:00
parent c796cbd7be
commit e6da340879

View File

@@ -67,7 +67,15 @@ fun ExpandableRichTextViewer(
accountViewModel: AccountViewModel,
nav: (String) -> Unit,
) {
var showFullText by remember { mutableStateOf(ShowFullTextCache.cache[id] ?: false) }
var showFullText by remember {
val cached = ShowFullTextCache.cache[id]
if (cached == null) {
ShowFullTextCache.cache.put(id, false)
mutableStateOf(false)
} else {
mutableStateOf(cached)
}
}
val whereToCut = remember(content) { ExpandableTextCutOffCalculator.indexToCutOff(content) }