mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Remove the unused media provider from the PillView.
This commit is contained in:
@@ -42,20 +42,17 @@ final class PillAttachmentViewProvider: NSTextAttachmentViewProvider, NSSecureCo
|
||||
}
|
||||
|
||||
let context: PillContext
|
||||
let mediaProvider: MediaProviderProtocol?
|
||||
if ProcessInfo.isXcodePreview || ProcessInfo.isRunningTests {
|
||||
// The mock viewModel simulates the loading logic for testing purposes
|
||||
context = PillContext.mock(viewState: .mention(isOwnMention: false, displayText: "Alice"), delay: .seconds(2))
|
||||
mediaProvider = MediaProviderMock(configuration: .init())
|
||||
} else if let timelineContext = delegate?.timelineContext {
|
||||
context = PillContext(timelineContext: timelineContext, data: pillData)
|
||||
mediaProvider = timelineContext.mediaProvider
|
||||
} else {
|
||||
MXLog.failure("Missing room context")
|
||||
return
|
||||
}
|
||||
|
||||
let view = PillView(mediaProvider: mediaProvider, context: context) { [weak self] in
|
||||
let view = PillView(context: context) { [weak self] in
|
||||
self?.delegate?.invalidateTextAttachmentsDisplay()
|
||||
}
|
||||
let controller = UIHostingController(rootView: view)
|
||||
|
||||
Reference in New Issue
Block a user