mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-08-08 20:42:19 +02:00
Fixes caching of time display.
This commit is contained in:
@@ -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,
|
||||||
|
Reference in New Issue
Block a user