Fix PR comment

This commit is contained in:
Claire G 2022-03-14 17:10:58 +01:00
parent 025dcc8d88
commit 6c7b4d4256

View file

@ -37,22 +37,16 @@ class ReadReceiptsItemFactory @Inject constructor(private val avatarRenderer: Av
val readReceiptsData = readReceipts
.map {
ReadReceiptData(it.roomMember.userId, it.roomMember.avatarUrl, it.roomMember.displayName, it.originServerTs)
}.toList()
val readReceiptsDataSorted = sortItem(readReceiptsData)
}
.sortedByDescending { it.timestamp }
return ReadReceiptsItem_()
.id("read_receipts_$eventId")
.eventId(eventId)
.readReceipts(readReceiptsDataSorted)
.readReceipts(readReceiptsData)
.avatarRenderer(avatarRenderer)
.shouldHideReadReceipts(isFromThreadTimeLine)
.clickListener {
callback?.onReadReceiptsClicked(readReceiptsDataSorted)
callback?.onReadReceiptsClicked(readReceiptsData)
}
}
fun sortItem(readReceipt: List<ReadReceiptData>): List<ReadReceiptData> {
return readReceipt.sortedByDescending {
it.timestamp
}
}
}