mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Hook up the actions in the media details sheet. (#3607)
This commit is contained in:
@@ -9,6 +9,7 @@ import Combine
|
||||
import Foundation
|
||||
|
||||
enum MediaEventsTimelineFlowCoordinatorAction {
|
||||
case viewInRoomTimeline(TimelineItemIdentifier)
|
||||
case finished
|
||||
}
|
||||
|
||||
@@ -91,6 +92,15 @@ class MediaEventsTimelineFlowCoordinator: FlowCoordinatorProtocol {
|
||||
|
||||
let coordinator = MediaEventsTimelineScreenCoordinator(parameters: parameters)
|
||||
|
||||
coordinator.actions
|
||||
.sink { [weak self] action in
|
||||
switch action {
|
||||
case .viewInRoomTimeline(let itemID):
|
||||
self?.actionsSubject.send(.viewInRoomTimeline(itemID))
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
navigationStackCoordinator.push(coordinator) { [weak self] in
|
||||
self?.actionsSubject.send(.finished)
|
||||
}
|
||||
|
||||
@@ -1546,6 +1546,13 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
guard let self else { return }
|
||||
|
||||
switch action {
|
||||
case .viewInRoomTimeline(let itemID):
|
||||
guard let eventID = itemID.eventID else {
|
||||
MXLog.error("Unable to present room timeline for event \(itemID)")
|
||||
return
|
||||
}
|
||||
stateMachine.tryEvent(.dismissMediaEventsTimeline)
|
||||
stateMachine.tryEvent(.presentRoom(presentationAction: .eventFocus(.init(eventID: eventID, shouldSetPin: false))))
|
||||
case .finished:
|
||||
stateMachine.tryEvent(.dismissMediaEventsTimeline)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user