From ed5f991cc7852de36038ed618260c11132dcb650 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 22 Jul 2025 14:08:19 +0300 Subject: [PATCH] Remove the `threadRootEventID` parameter from the actions the `ThreadTimelineScreenCoordinator` forwards --- .../RoomFlowCoordinator.swift | 8 +++---- .../ThreadTimelineScreenCoordinator.swift | 24 ++++++++----------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 6721ddc35..9ddd82774 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -638,18 +638,18 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { switch action { case .presentReportContent(let itemID, let senderID): stateMachine.tryEvent(.presentReportContent(itemID: itemID, senderID: senderID)) - case .presentMediaUploadPicker(let source, let threadRootEventID): + case .presentMediaUploadPicker(let source): stateMachine.tryEvent(.presentMediaUploadPicker(source: source), userInfo: EventUserInfo(animated: animated, timelineController: timelineController)) - case .presentMediaUploadPreviewScreen(let url, let threadRootEventID): + case .presentMediaUploadPreviewScreen(let url): stateMachine.tryEvent(.presentMediaUploadPreview(fileURL: url), userInfo: EventUserInfo(animated: animated, timelineController: timelineController)) - case .presentLocationPicker(let threadRootEventID): + case .presentLocationPicker: stateMachine.tryEvent(.presentMapNavigator(interactionMode: .picker), userInfo: EventUserInfo(animated: animated, timelineController: timelineController)) case .presentPollForm(let mode): stateMachine.tryEvent(.presentPollForm(mode: mode)) - case .presentLocationViewer(_, let geoURI, let description, let threadRootEventID): + case .presentLocationViewer(_, let geoURI, let description): stateMachine.tryEvent(.presentMapNavigator(interactionMode: .viewOnly(geoURI: geoURI, description: description)), userInfo: EventUserInfo(animated: animated, timelineController: timelineController)) diff --git a/ElementX/Sources/Screens/ThreadTimelineScreen/ThreadTimelineScreenCoordinator.swift b/ElementX/Sources/Screens/ThreadTimelineScreen/ThreadTimelineScreenCoordinator.swift index 25cea37bf..7ab29a5b5 100644 --- a/ElementX/Sources/Screens/ThreadTimelineScreen/ThreadTimelineScreenCoordinator.swift +++ b/ElementX/Sources/Screens/ThreadTimelineScreen/ThreadTimelineScreenCoordinator.swift @@ -27,10 +27,10 @@ struct ThreadTimelineScreenCoordinatorParameters { enum ThreadTimelineScreenCoordinatorAction { case presentReportContent(itemID: TimelineItemIdentifier, senderID: String) - case presentMediaUploadPicker(MediaPickerScreenSource, threadRootEventID: String?) - case presentMediaUploadPreviewScreen(url: URL, threadRootEventID: String?) - case presentLocationPicker(threadRootEventID: String?) - case presentLocationViewer(body: String, geoURI: GeoURI, description: String?, threadRootEventID: String?) + case presentMediaUploadPicker(MediaPickerScreenSource) + case presentMediaUploadPreviewScreen(url: URL) + case presentLocationPicker + case presentLocationViewer(body: String, geoURI: GeoURI, description: String?) case presentPollForm(mode: PollFormMode) case presentEmojiPicker(itemID: TimelineItemIdentifier, selectedEmojis: Set) case presentRoomMemberDetails(userID: String) @@ -97,27 +97,23 @@ final class ThreadTimelineScreenCoordinator: CoordinatorProtocol { case .displayReportContent(let itemID, let senderID): actionsSubject.send(.presentReportContent(itemID: itemID, senderID: senderID)) case .displayCameraPicker: - actionsSubject.send(.presentMediaUploadPicker(.camera, - threadRootEventID: parameters.timelineController.timelineKind.threadRootEventID)) + actionsSubject.send(.presentMediaUploadPicker(.camera)) case .displayMediaPicker: - actionsSubject.send(.presentMediaUploadPicker(.photoLibrary, - threadRootEventID: parameters.timelineController.timelineKind.threadRootEventID)) + actionsSubject.send(.presentMediaUploadPicker(.photoLibrary)) case .displayDocumentPicker: - actionsSubject.send(.presentMediaUploadPicker(.documents, - threadRootEventID: parameters.timelineController.timelineKind.threadRootEventID)) + actionsSubject.send(.presentMediaUploadPicker(.documents)) case .displayMediaPreview(let mediaPreviewViewModel): viewModel.displayMediaPreview(mediaPreviewViewModel) case .displayLocationPicker: - actionsSubject.send(.presentLocationPicker(threadRootEventID: parameters.timelineController.timelineKind.threadRootEventID)) + actionsSubject.send(.presentLocationPicker) case .displayLocation(let body, let geoURI, let description): actionsSubject.send(.presentLocationViewer(body: body, geoURI: geoURI, - description: description, threadRootEventID: parameters.timelineController.timelineKind.threadRootEventID)) + description: description)) case .displayPollForm(let mode): actionsSubject.send(.presentPollForm(mode: mode)) case .displayMediaUploadPreviewScreen(let url): - actionsSubject.send(.presentMediaUploadPreviewScreen(url: url, - threadRootEventID: parameters.timelineController.timelineKind.threadRootEventID)) + actionsSubject.send(.presentMediaUploadPreviewScreen(url: url)) case .displaySenderDetails(userID: let userID): actionsSubject.send(.presentRoomMemberDetails(userID: userID)) case .displayMessageForwarding(let forwardingItem):