Skip to content

Commit

Permalink
Fix capturing self and calling additional configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
wiruzx committed Feb 5, 2019
1 parent bc1a15e commit e5719f3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public final class CompoundMessagePresenter<ViewModelBuilderT, InteractionHandle
return
}

super.configureCell(compoundCell, decorationAttributes: decorationAttributes, animated: animated) {
super.configureCell(compoundCell, decorationAttributes: decorationAttributes, animated: animated) { [weak self] in
guard let self = self else { return }
guard compoundCell.lastDisplayedModel != self.messageModel else { return }
compoundCell.lastDisplayedModel = self.messageModel
let modules = self.contentFactories.map { $0.createMessageModule(forModel: self.messageModel) }
Expand All @@ -100,6 +101,7 @@ public final class CompoundMessagePresenter<ViewModelBuilderT, InteractionHandle
bubbleView.style = self.compoundCellStyle
bubbleView.decoratedContentViews = modules.map { .init(module: $0) }
bubbleView.layoutProvider = self.layoutProvider
additionalConfiguration?()
}
}

Expand Down

0 comments on commit e5719f3

Please sign in to comment.