@@ -16,7 +16,7 @@ struct QuotedMessageViewContainer: View {
16
16
17
17
var body : some View {
18
18
HStack ( alignment: . bottom) {
19
- if !message . isSentByCurrentUser {
19
+ if !quotedMessage . isSentByCurrentUser {
20
20
MessageAvatarView (
21
21
author: quotedMessage. author,
22
22
size: . init( width: avatarSize, height: avatarSize)
@@ -55,36 +55,40 @@ struct QuotedMessageView: View {
55
55
56
56
var body : some View {
57
57
HStack ( alignment: . top) {
58
- ZStack {
59
- if !quotedMessage. imageAttachments. isEmpty {
60
- LazyLoadingImage (
61
- source: quotedMessage. imageAttachments [ 0 ] . imagePreviewURL,
62
- width: attachmentWidth,
63
- resize: false
64
- )
65
- } else if !quotedMessage. giphyAttachments. isEmpty {
66
- LazyGiphyView (
67
- source: quotedMessage. giphyAttachments [ 0 ] . previewURL,
68
- width: attachmentWidth
69
- )
70
- } else if !quotedMessage. fileAttachments. isEmpty {
71
- Image ( uiImage: filePreviewImage ( for: quotedMessage. fileAttachments [ 0 ] . assetURL) )
72
- } else if !quotedMessage. videoAttachments. isEmpty {
73
- VideoAttachmentView (
74
- attachment: quotedMessage. videoAttachments [ 0 ] ,
75
- message: quotedMessage,
76
- width: attachmentWidth
77
- )
78
- } else if !quotedMessage. linkAttachments. isEmpty {
79
- LazyImage ( source: quotedMessage. linkAttachments [ 0 ] . previewURL!)
80
- . onDisappear ( . reset)
81
- . processors ( [ ImageProcessors . Resize ( width: attachmentWidth) ] )
82
- . priority ( . high)
58
+ if !quotedMessage. attachmentCounts. isEmpty {
59
+ ZStack {
60
+ if !quotedMessage. imageAttachments. isEmpty {
61
+ LazyLoadingImage (
62
+ source: quotedMessage. imageAttachments [ 0 ] . imagePreviewURL,
63
+ width: attachmentWidth,
64
+ resize: false
65
+ )
66
+ } else if !quotedMessage. giphyAttachments. isEmpty {
67
+ LazyGiphyView (
68
+ source: quotedMessage. giphyAttachments [ 0 ] . previewURL,
69
+ width: attachmentWidth
70
+ )
71
+ } else if !quotedMessage. fileAttachments. isEmpty {
72
+ Image ( uiImage: filePreviewImage ( for: quotedMessage. fileAttachments [ 0 ] . assetURL) )
73
+ } else if !quotedMessage. videoAttachments. isEmpty {
74
+ VideoAttachmentView (
75
+ attachment: quotedMessage. videoAttachments [ 0 ] ,
76
+ message: quotedMessage,
77
+ width: attachmentWidth,
78
+ ratio: 1.0 ,
79
+ cornerRadius: 0
80
+ )
81
+ } else if !quotedMessage. linkAttachments. isEmpty {
82
+ LazyImage ( source: quotedMessage. linkAttachments [ 0 ] . previewURL!)
83
+ . onDisappear ( . reset)
84
+ . processors ( [ ImageProcessors . Resize ( width: attachmentWidth) ] )
85
+ . priority ( . high)
86
+ }
83
87
}
88
+ . frame ( width: attachmentWidth, height: attachmentWidth)
89
+ . aspectRatio ( 1 , contentMode: . fill)
90
+ . clipShape ( RoundedRectangle ( cornerRadius: 8 ) )
84
91
}
85
- . frame ( width: attachmentWidth, height: attachmentWidth)
86
- . aspectRatio ( 1 , contentMode: . fill)
87
- . clipShape ( RoundedRectangle ( cornerRadius: 8 ) )
88
92
89
93
Text ( textForMessage)
90
94
. lineLimit ( 3 )
0 commit comments