File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Sources/StreamChatSwiftUI/ChatChannel/MessageList Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public struct LinkAttachmentView: View {
81
81
VStack ( alignment: . leading, spacing: padding) {
82
82
if !imageHidden {
83
83
ZStack {
84
- LazyImage ( source: linkAttachment. previewURL! )
84
+ LazyImage ( source: linkAttachment. previewURL ?? linkAttachment . originalURL )
85
85
. onDisappear ( . cancel)
86
86
. processors ( [ ImageProcessors . Resize ( width: width) ] )
87
87
. priority ( . high)
@@ -90,7 +90,7 @@ public struct LinkAttachmentView: View {
90
90
91
91
if !authorHidden {
92
92
BottomLeftView {
93
- Text ( linkAttachment. author! )
93
+ Text ( linkAttachment. author ?? " " )
94
94
. foregroundColor ( colors. tintColor)
95
95
. font ( fonts. bodyBold)
96
96
. standardPadding ( )
Original file line number Diff line number Diff line change @@ -108,10 +108,13 @@ public struct QuotedMessageView<Factory: ViewFactory>: View {
108
108
cornerRadius: 0
109
109
)
110
110
} else if !quotedMessage. linkAttachments. isEmpty {
111
- LazyImage ( source: quotedMessage. linkAttachments [ 0 ] . previewURL!)
112
- . onDisappear ( . cancel)
113
- . processors ( [ ImageProcessors . Resize ( width: attachmentWidth) ] )
114
- . priority ( . high)
111
+ LazyImage (
112
+ source: quotedMessage. linkAttachments [ 0 ] . previewURL ?? quotedMessage. linkAttachments [ 0 ]
113
+ . originalURL
114
+ )
115
+ . onDisappear ( . cancel)
116
+ . processors ( [ ImageProcessors . Resize ( width: attachmentWidth) ] )
117
+ . priority ( . high)
115
118
}
116
119
}
117
120
. frame ( width: attachmentWidth, height: attachmentWidth)
You can’t perform that action at this time.
0 commit comments