mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-01 01:03:01 +00:00
Setup the threaded timeline media preview action
This commit is contained in:
committed by
Stefan Ceriu
parent
bc1f7ca646
commit
565ca3ab0b
@@ -28,4 +28,18 @@ class ThreadTimelineScreenViewModel: ThreadTimelineScreenViewModelType, ThreadTi
|
||||
// Work around QLPreviewController dismissal issues, see the InteractiveQuickLookModifier.
|
||||
state.bindings.mediaPreviewViewModel = nil
|
||||
}
|
||||
|
||||
func displayMediaPreview(_ mediaPreviewViewModel: TimelineMediaPreviewViewModel) {
|
||||
mediaPreviewViewModel.actions.sink { [weak self] action in
|
||||
switch action {
|
||||
case .viewInRoomTimeline:
|
||||
fatalError("viewInRoomTimeline should not be visible on a thread preview.")
|
||||
case .dismiss:
|
||||
self?.state.bindings.mediaPreviewViewModel = nil
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
state.bindings.mediaPreviewViewModel = mediaPreviewViewModel
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user