diff --git a/Session/Conversations/Message Cells/Content Views/ReactionContainerView.swift b/Session/Conversations/Message Cells/Content Views/ReactionContainerView.swift index 4d5d91d45..8ddf28bb6 100644 --- a/Session/Conversations/Message Cells/Content Views/ReactionContainerView.swift +++ b/Session/Conversations/Message Cells/Content Views/ReactionContainerView.swift @@ -10,6 +10,7 @@ final class ReactionContainerView : UIView { private var showingAllReactions = false + var reactions: [(String, (Int, Bool))] = [] var reactionViews: [ReactionView] = [] var expandButton: ExpandingReactionButton? @@ -33,6 +34,7 @@ final class ReactionContainerView : UIView { } public func update(_ reactions: [(String, (Int, Bool))]) { + self.reactions = reactions prepareForUpdate() let stackView = UIStackView() @@ -58,7 +60,7 @@ final class ReactionContainerView : UIView { } if expandButtonReactions.count > 0 { expandButton = ExpandingReactionButton(emojis: expandButtonReactions) - stackView.addArrangedSubview(expandButton) + stackView.addArrangedSubview(expandButton!) } else { expandButton = nil } @@ -72,6 +74,12 @@ final class ReactionContainerView : UIView { } reactionViews = [] } + + public func showAllEmojis() { + guard !showingAllReactions else { return } + showingAllReactions = true + update(reactions) + } } diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index 55cf89058..45f6f3647 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -562,6 +562,7 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate { } if let expandButton = reactionContainerView.expandButton, expandButton.frame.contains(convertedLocation) { // TODO: show all emojis + reactionContainerView. } } else { delegate?.handleViewItemTapped(viewItem, gestureRecognizer: gestureRecognizer)