Skip to content

Commit 0af168a

Browse files
Fix not showing empty youtube or rumble link preview
1 parent f404a28 commit 0af168a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/src/main/kotlin/net/primal/android/notes/feed/note/ui/attachment/NoteAttachments.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ fun NoteAttachments(
4545
attachments
4646
.filterNot { it.isMediaAttachment() }
4747
.take(n = if (!expanded) 2 else Int.MAX_VALUE)
48+
.filter {
49+
when (it.type) {
50+
NoteAttachmentType.YouTube, NoteAttachmentType.Rumble -> {
51+
it.title != null || it.thumbnailUrl != null
52+
}
53+
else -> true
54+
}
55+
}
4856
.forEach { attachment ->
4957
NoteLinkAttachment(
5058
modifier = modifier,

0 commit comments

Comments
 (0)