diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/postprocessor/LastForwardIndicatorsPostProcessor.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/postprocessor/LastForwardIndicatorsPostProcessor.kt index 8db3952f0d..d717fac00d 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/postprocessor/LastForwardIndicatorsPostProcessor.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/postprocessor/LastForwardIndicatorsPostProcessor.kt @@ -65,10 +65,7 @@ private fun createLastForwardIndicator(identifier: String): MatrixTimelineItem { private fun List.latestEventIdentifier(): String { return findLast { - when (it) { - is MatrixTimelineItem.Event -> true - else -> false - } + it is MatrixTimelineItem.Event }?.let { (it as MatrixTimelineItem.Event).uniqueId } ?: "fake_id"