From 38515a97183b886dac625176800bc9fa34c6d3c0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 22 Jan 2024 14:21:49 +0100 Subject: [PATCH] Fix detekt issue: Use `?.let {}` instead of if/else with a null block when checking for nullable values [UseLet] --- .../features/roomlist/impl/model/RoomListRoomSummaryProvider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummaryProvider.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummaryProvider.kt index e312d2bf14..0a45aa10f9 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummaryProvider.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummaryProvider.kt @@ -49,7 +49,7 @@ internal fun aRoomListRoomSummary( name: String = "Room name", hasUnread: Boolean = false, lastMessage: String? = "Last message", - timestamp: String? = if (lastMessage != null) "88:88" else null, + timestamp: String? = lastMessage?.let { "88:88" }, isPlaceholder: Boolean = false, notificationMode: RoomNotificationMode? = null, hasRoomCall: Boolean = false,