Skip to content

Commit

Permalink
Replace loading presenter setup with general one
Browse files Browse the repository at this point in the history
  • Loading branch information
wiruzx committed Oct 26, 2023
1 parent 43364b0 commit 3b550e3
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ open class CompoundMessagePresenter<ViewModelBuilderT, InteractionHandlerT>
private let initialDecorationFactories: [AnyMessageDecorationViewFactory<ModelT>]
private var decorationFactories: [AnyMessageDecorationViewFactory<ModelT>] = []
private var menuPresenter: ChatItemMenuPresenterProtocol?
private let contentLoadingPresenterSetup: ((MessageContentLoadingPresenterProtocol) -> Void)?
private let contentPresenterSetup: ((MessageContentPresenterProtocol) -> Void)?

public init(
messageModel: ModelT,
Expand All @@ -61,15 +61,15 @@ open class CompoundMessagePresenter<ViewModelBuilderT, InteractionHandlerT>
accessibilityIdentifier: String?,
decorationFactories: [AnyMessageDecorationViewFactory<ModelT>] = [],
cellClass: CompoundMessageCollectionViewCell.Type = CompoundMessageCollectionViewCell.self,
contentLoadingPresenterSetup: ((MessageContentLoadingPresenterProtocol) -> Void)? = nil
contentPresenterSetup: ((MessageContentPresenterProtocol) -> Void)? = nil
) {
self.compoundCellStyle = compoundCellStyle
self.initialContentFactories = contentFactories
self.cache = cache
self.accessibilityIdentifier = accessibilityIdentifier
self.cellClass = cellClass
self.initialDecorationFactories = decorationFactories
self.contentLoadingPresenterSetup = contentLoadingPresenterSetup
self.contentPresenterSetup = contentPresenterSetup
super.init(
messageModel: messageModel,
viewModelBuilder: viewModelBuilder,
Expand Down Expand Up @@ -322,9 +322,7 @@ open class CompoundMessagePresenter<ViewModelBuilderT, InteractionHandlerT>
self?.handleContentTransferStatusUpdate()
})
}
if let contentLoading = presenter as? MessageContentLoadingPresenterProtocol {
self.contentLoadingPresenterSetup?(contentLoading)
}
self.contentPresenterSetup?(presenter)
return presenter
}

Expand Down

0 comments on commit 3b550e3

Please sign in to comment.