implemented navigation for permalinks to threads

also this handles the case where we are permalinking to non existent (or impossible to fetch) event.
This commit is contained in:
Mauro Romito
2025-10-01 13:18:53 +02:00
committed by Mauro
parent cf5a72bc10
commit 0288ce6b4b
6 changed files with 100 additions and 47 deletions
@@ -13,6 +13,7 @@ import WysiwygComposer
struct ThreadTimelineScreenCoordinatorParameters {
let userSession: UserSessionProtocol
let roomProxy: JoinedRoomProxyProtocol
let focussedEventID: String?
let timelineController: TimelineControllerProtocol
let mediaPlayerProvider: MediaPlayerProviderProtocol
let emojiProvider: EmojiProviderProtocol
@@ -58,6 +59,7 @@ final class ThreadTimelineScreenCoordinator: CoordinatorProtocol {
viewModel = ThreadTimelineScreenViewModel(roomProxy: parameters.roomProxy, userSession: parameters.userSession)
timelineViewModel = TimelineViewModel(roomProxy: parameters.roomProxy,
focussedEventID: parameters.focussedEventID,
timelineController: parameters.timelineController,
userSession: parameters.userSession,
mediaPlayerProvider: parameters.mediaPlayerProvider,
@@ -155,4 +157,8 @@ final class ThreadTimelineScreenCoordinator: CoordinatorProtocol {
timelineContext: timelineViewModel.context,
composerToolbar: composerToolbar))
}
func focusOnEvent(eventID: String) {
Task { await timelineViewModel.focusOnEvent(eventID: eventID) }
}
}