Skip to content

Commit

Permalink
Config for enforcing unique reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski committed Dec 27, 2023
1 parent 0861a1d commit b4b1d4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
# Upcoming

### ✅ Added
- Configuration for highlighted composer border color
- Config for highlighted composer border color
- Config for enforcing unique reactions

### 🐞 Fixed
- Improved loading of gallery images
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public struct MessageListConfig {
scrollingAnchor: UnitPoint = .bottom,
showNewMessagesSeparator: Bool = true,
handleTabBarVisibility: Bool = true,
messageListAlignment: MessageListAlignment = .standard
messageListAlignment: MessageListAlignment = .standard,
uniqueReactionsEnabled: Bool = false
) {
self.messageListType = messageListType
self.typingIndicatorPlacement = typingIndicatorPlacement
Expand All @@ -46,6 +47,7 @@ public struct MessageListConfig {
self.showNewMessagesSeparator = showNewMessagesSeparator
self.handleTabBarVisibility = handleTabBarVisibility
self.messageListAlignment = messageListAlignment
self.uniqueReactionsEnabled = uniqueReactionsEnabled
}

public let messageListType: MessageListType
Expand All @@ -66,6 +68,7 @@ public struct MessageListConfig {
public let showNewMessagesSeparator: Bool
public let handleTabBarVisibility: Bool
public let messageListAlignment: MessageListAlignment
public let uniqueReactionsEnabled: Bool
}

/// Contains information about the message paddings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ open class ReactionsOverlayViewModel: ObservableObject, ChatMessageControllerDel
messageController?.deleteReaction(reaction)
} else {
// reaction should be added
messageController?.addReaction(reaction)
messageController?.addReaction(
reaction,
enforceUnique: utils.messageListConfig.uniqueReactionsEnabled
)
}
}

Expand Down

0 comments on commit b4b1d4c

Please sign in to comment.