diff --git a/stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channel/ChannelMediaAttachmentsPreviewViewModelTest.kt b/stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channel/ChannelMediaAttachmentsPreviewViewModelTest.kt index 6ab98faea2e..165d77bb9f5 100644 --- a/stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channel/ChannelMediaAttachmentsPreviewViewModelTest.kt +++ b/stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channel/ChannelMediaAttachmentsPreviewViewModelTest.kt @@ -254,6 +254,9 @@ internal class ChannelMediaAttachmentsPreviewViewModelTest { val attachment = randomAttachment( // Less than 10MB fileSize = positiveRandomInt(maxInt = (10 * 1024 * 1024) - 1), + assetUrl = null, + imageUrl = null, + thumbUrl = null, ) val shareError = Error.GenericError(message = randomString()) val sut = Fixture() diff --git a/stream-chat-android-previewdata/src/main/kotlin/io/getstream/chat/android/previewdata/PreviewMessageData.kt b/stream-chat-android-previewdata/src/main/kotlin/io/getstream/chat/android/previewdata/PreviewMessageData.kt index 7355e1c443a..b7b194e2877 100644 --- a/stream-chat-android-previewdata/src/main/kotlin/io/getstream/chat/android/previewdata/PreviewMessageData.kt +++ b/stream-chat-android-previewdata/src/main/kotlin/io/getstream/chat/android/previewdata/PreviewMessageData.kt @@ -122,14 +122,12 @@ public object PreviewMessageData { type = "image", mimeType = "image/jpeg", imageUrl = "https://example.com/image1.jpg", - thumbUrl = "https://example.com/thumb1.jpg", ), Attachment( name = "video1.mp4", fileSize = 2000000, type = "video", mimeType = "video/mp4", - imageUrl = "https://example.com/image1.jpg", thumbUrl = "https://example.com/thumb1.jpg", ), ), diff --git a/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/channel/attachments/ChannelAttachmentsViewState.kt b/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/channel/attachments/ChannelAttachmentsViewState.kt index ec773233bbf..44e04e285a0 100644 --- a/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/channel/attachments/ChannelAttachmentsViewState.kt +++ b/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/channel/attachments/ChannelAttachmentsViewState.kt @@ -18,7 +18,6 @@ package io.getstream.chat.android.ui.common.state.channel.attachments import io.getstream.chat.android.models.Attachment import io.getstream.chat.android.models.Message -import io.getstream.chat.android.ui.common.utils.extensions.getDisplayableName import io.getstream.chat.android.ui.common.utils.extensions.imagePreviewUrl /** @@ -61,7 +60,7 @@ public sealed interface ChannelAttachmentsViewState { * Returns the unique identifier for the item. */ public val id: String = - "${message.identifierHash()}-${attachment.getDisplayableName() ?: attachment.imagePreviewUrl}" + "${message.identifierHash()}-${attachment.imagePreviewUrl}" } }