fix: rename updatedAt field to lastEditedAt for comments

This commit is contained in:
Devon Sawatsky 2025-02-13 14:24:56 -08:00 committed by Harsh Shandilya
parent bff573ec10
commit bb11ede32a
2 changed files with 8 additions and 8 deletions

View file

@ -225,7 +225,7 @@ private fun CommentEntry(
commenterName = comment.user, commenterName = comment.user,
score = comment.score, score = comment.score,
createdAt = comment.createdAt, createdAt = comment.createdAt,
updatedAt = comment.updatedAt, lastEditedAt = comment.lastEditedAt,
nameColorOverride = nameColorOverride =
if (commentNode.isPostAuthor) MaterialTheme.colorScheme.tertiary else null, if (commentNode.isPostAuthor) MaterialTheme.colorScheme.tertiary else null,
), ),
@ -247,7 +247,7 @@ private fun buildCommenterString(
commenterName: String, commenterName: String,
score: Int, score: Int,
createdAt: TemporalAccessor, createdAt: TemporalAccessor,
updatedAt: TemporalAccessor, lastEditedAt: TemporalAccessor,
nameColorOverride: Color? = null, nameColorOverride: Color? = null,
): AnnotatedString { ): AnnotatedString {
val now = System.currentTimeMillis() val now = System.currentTimeMillis()
@ -257,9 +257,9 @@ private fun buildCommenterString(
now, now,
DateUtils.MINUTE_IN_MILLIS, DateUtils.MINUTE_IN_MILLIS,
) )
val updatedRelative = val lastEditedRelative =
DateUtils.getRelativeTimeSpanString( DateUtils.getRelativeTimeSpanString(
Instant.from(updatedAt).toEpochMilli(), Instant.from(lastEditedAt).toEpochMilli(),
now, now,
DateUtils.MINUTE_IN_MILLIS, DateUtils.MINUTE_IN_MILLIS,
) )
@ -277,12 +277,12 @@ private fun buildCommenterString(
append('•') append('•')
append(' ') append(' ')
append(createdRelative.toString()) append(createdRelative.toString())
if (updatedRelative != createdRelative) { if (lastEditedRelative != createdRelative) {
append(' ') append(' ')
append('(') append('(')
append("Updated") append("Edited")
append(' ') append(' ')
append(updatedRelative.toString()) append(lastEditedRelative.toString())
append(')') append(')')
} }
} }

View file

@ -22,7 +22,7 @@ class Comment(
val url: String, val url: String,
val score: Int, val score: Int,
@Serializable(with = JavaInstantSerializer::class) val createdAt: TemporalAccessor, @Serializable(with = JavaInstantSerializer::class) val createdAt: TemporalAccessor,
@Serializable(with = JavaInstantSerializer::class) val updatedAt: TemporalAccessor, @Serializable(with = JavaInstantSerializer::class) val lastEditedAt: TemporalAccessor,
val parentComment: String?, val parentComment: String?,
@SerialName("commenting_user") val user: String, @SerialName("commenting_user") val user: String,
) )