Skip to content

Commit 7d7a376

Browse files
Added config for disabling reactions popover
1 parent e904a7f commit 7d7a376

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ open class ChatChannelViewModel: ObservableObject, MessagesDataSource {
6161
@Published public var currentSnapshot: UIImage? {
6262
didSet {
6363
withAnimation {
64-
reactionsShown = currentSnapshot != nil
64+
reactionsShown = currentSnapshot != nil && utils.messageListConfig.messagePopoverEnabled
6565
}
6666
}
6767
}

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListConfig.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public struct MessageListConfig {
1414
messageDisplayOptions: MessageDisplayOptions = MessageDisplayOptions(),
1515
messagePaddings: MessagePaddings = MessagePaddings(),
1616
dateIndicatorPlacement: DateIndicatorPlacement = .overlay,
17-
pageSize: Int = 50
17+
pageSize: Int = 50,
18+
messagePopoverEnabled: Bool = true
1819
) {
1920
self.messageListType = messageListType
2021
self.typingIndicatorPlacement = typingIndicatorPlacement
@@ -23,6 +24,7 @@ public struct MessageListConfig {
2324
self.messagePaddings = messagePaddings
2425
self.dateIndicatorPlacement = dateIndicatorPlacement
2526
self.pageSize = pageSize
27+
self.messagePopoverEnabled = messagePopoverEnabled
2628
}
2729

2830
let messageListType: MessageListType
@@ -32,6 +34,7 @@ public struct MessageListConfig {
3234
let messagePaddings: MessagePaddings
3335
let dateIndicatorPlacement: DateIndicatorPlacement
3436
let pageSize: Int
37+
let messagePopoverEnabled: Bool
3538
}
3639

3740
/// Contains information about the message paddings.

0 commit comments

Comments
 (0)