Skip to content

Commit

Permalink
Properly setup regestiring custom attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
nuno-vieira committed Jan 9, 2024
1 parent fbd4bd3 commit 2e77844
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions DemoApp/StreamChat/StreamChatWrapper+DemoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import StreamChatUI
extension StreamChatWrapper {
// Instantiates chat client
func setUpChat() {
configureUI()
if AppConfig.shared.demoAppConfig.isLocationAttachmentsEnabled {
Components.default.mixedAttachmentInjector.register(.location, with: LocationAttachmentViewInjector.self)
}

guard client == nil else {
log.error("Client was already instantiated")
Expand Down Expand Up @@ -59,9 +61,5 @@ extension StreamChatWrapper {
Components.default.messageActionsVC = DemoChatMessageActionsVC.self
Components.default.reactionsSorting = { $0.type.position < $1.type.position }
Components.default.messageLayoutOptionsResolver = DemoChatMessageLayoutOptionsResolver()

if AppConfig.shared.demoAppConfig.isLocationAttachmentsEnabled {
Components.default.mixedAttachmentInjector.register(.location, with: LocationAttachmentViewInjector.self)
}
}
}

0 comments on commit 2e77844

Please sign in to comment.