Skip to content

Commit bc857d6

Browse files
bug fixes and improvements for loading user avatars
1 parent 7b5a75f commit bc857d6

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

DemoAppSwiftUI/NewChatView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ struct ChatUserView: View {
203203

204204
var body: some View {
205205
HStack {
206-
MessageAvatarView(author: user)
206+
LazyView(
207+
MessageAvatarView(author: user)
208+
)
209+
207210
VStack(alignment: .leading, spacing: 4) {
208211
Text(user.name ?? user.id)
209212
.lineLimit(1)

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct MessageContainerView<Factory: ViewFactory>: View {
109109
}
110110

111111
private var reactionsShown: Bool {
112-
!message.reactionScores.isEmpty
112+
!message.reactionScores.isEmpty && !message.isDeleted
113113
}
114114
}
115115

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListItem.swift

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,17 @@ public struct ChannelAvatarView: View {
105105
var size: CGSize = .defaultAvatarSize
106106

107107
public var body: some View {
108-
AvatarView(avatar: avatar, size: size)
109-
.overlay(
110-
showOnlineIndicator ?
111-
TopRightView {
112-
OnlineIndicatorView(indicatorSize: size.width * 0.3)
113-
}
114-
.offset(x: 3, y: -1)
115-
: nil
116-
)
108+
LazyView(
109+
AvatarView(avatar: avatar, size: size)
110+
.overlay(
111+
showOnlineIndicator ?
112+
TopRightView {
113+
OnlineIndicatorView(indicatorSize: size.width * 0.3)
114+
}
115+
.offset(x: 3, y: -1)
116+
: nil
117+
)
118+
)
117119
}
118120
}
119121

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public class ChatChannelListViewModel: ObservableObject, ChatChannelListControll
5050
}
5151

5252
@Published var deeplinkChannel: ChatChannel?
53-
@Published var loadedImages = [String: UIImage]()
5453
@Published var currentChannelId: String?
5554
@Published var channelAlertType: ChannelAlertType? {
5655
didSet {

0 commit comments

Comments
 (0)