Fixes caching of time display.

This commit is contained in:
Vitor Pamplona
2023-07-07 09:45:21 -04:00
parent 9e2b2cedd6
commit a26c7e3d97

View File

@@ -2237,14 +2237,14 @@ fun MoreOptionsButton(
@Composable @Composable
fun TimeAgo(note: Note) { fun TimeAgo(note: Note) {
val time = remember { note.createdAt() } ?: return val time = remember(note) { note.createdAt() } ?: return
TimeAgo(time) TimeAgo(time)
} }
@Composable @Composable
fun TimeAgo(time: Long) { fun TimeAgo(time: Long) {
val context = LocalContext.current val context = LocalContext.current
val timeStr by remember { mutableStateOf(timeAgo(time, context = context)) } val timeStr by remember(time) { mutableStateOf(timeAgo(time, context = context)) }
Text( Text(
text = timeStr, text = timeStr,