Skip to content

Commit

Permalink
[i288] fix message footer displaying wrong date
Browse files Browse the repository at this point in the history
  • Loading branch information
kanat authored and JcMinarro committed May 6, 2024
1 parent cec5306 commit fa62521
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,16 @@ public fun MessageFooter(
)
}

val date = message.updatedAt ?: message.createdAt ?: message.createdLocallyAt
val updatedAt = message.updatedAt
val createdAt = message.createdAt ?: message.createdLocallyAt
val date = when {
createdAt == null -> updatedAt
updatedAt == null -> createdAt
else -> when (updatedAt.after(createdAt)) {
true -> updatedAt
else -> createdAt
}
}
if (date != null) {
Timestamp(date = date, formatType = DateFormatType.TIME)
}
Expand Down

0 comments on commit fa62521

Please sign in to comment.