diff --git a/Riot/Modules/Room/Views/BubbleCells/Poll/PollBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Poll/PollBubbleCell.swift index c9263a37b..c1dc7a770 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Poll/PollBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Poll/PollBubbleCell.swift @@ -34,10 +34,7 @@ class PollBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable { } self.event = event - - pollView?.removeFromSuperview() - contentView.vc_addSubViewMatchingParent(view) - pollView = view + self.addPollView(view, on: contentView) } override func setupViews() { @@ -56,6 +53,13 @@ class PollBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable { delegate.cell(self, didRecognizeAction: kMXKRoomBubbleCellTapOnContentView, userInfo: [kMXKRoomBubbleCellEventKey: event]) } + + func addPollView(_ pollView: UIView, on contentView: UIView) { + + self.pollView?.removeFromSuperview() + contentView.vc_addSubViewMatchingParent(pollView) + self.pollView = pollView + } } extension PollBubbleCell: BubbleCellThreadSummaryDisplayable {}