From 75eeafa9aeadfacd26365e90a73f2ff5cb9b590e Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 1 Oct 2025 14:22:47 +0200 Subject: [PATCH] when focussing an event in a thread of a new room, focus the thread root in the room that has been opened --- ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index e831c9523..4b0cec78b 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -173,6 +173,9 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { if case .thread(threadRootEventID: threadRootEventID, _) = stateMachine.state, let threadCoordinator = childThreads.last { threadCoordinator.focusOnEvent(eventID: eventID) } else { + if childThreads.isEmpty { + roomScreenCoordinator?.focusOnEvent(.init(eventID: eventID, shouldSetPin: false)) + } stateMachine.tryEvent(.presentThread(threadRootEventID: threadRootEventID, focusEventID: eventID)) } } else if !childThreads.isEmpty { @@ -260,7 +263,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { guard flowParameters.appSettings.threadsEnabled, let threadRootEventID = event.threadRootEventId() else { break } - stateMachine.tryEvent(.presentRoom(presentationAction: nil), userInfo: EventUserInfo(animated: animated)) + stateMachine.tryEvent(.presentRoom(presentationAction: .eventFocus(.init(eventID: threadRootEventID, shouldSetPin: false))), userInfo: EventUserInfo(animated: animated)) stateMachine.tryEvent(.presentThread(threadRootEventID: threadRootEventID, focusEventID: focusEvent.eventID), userInfo: EventUserInfo(animated: false)) return case .failure: