refactor(healthchat): move the session hooks onto UserHooks

This commit is contained in:
Sedat Qaja
2026-10-19 09:18:07 +02:00
parent 1b34a71857
commit 979d20572d
22 changed files with 725 additions and 409 deletions
@@ -121,7 +121,6 @@ final class HealthChatMembersFlowCoordinator {
let parameters = UserProfileScreenCoordinatorParameters(userID: userID,
isPresentedModally: false,
userSession: flowParameters.userSession,
appHooks: flowParameters.appHooks,
analytics: flowParameters.analytics,
userIndicatorController: flowParameters.userIndicatorController)
let coordinator = UserProfileScreenCoordinator(parameters: parameters)
@@ -148,7 +147,7 @@ final class HealthChatMembersFlowCoordinator {
private func presentProfileEditor() {
let parameters = UserDetailsEditScreenCoordinatorParameters(orientationManager: flowParameters.windowManager,
userSession: flowParameters.userSession,
mediaUploadingPreprocessor: MediaUploadingPreprocessor(appSettings: flowParameters.appSettings),
mediaUploadingPreprocessor: MediaUploadingPreprocessor(userSettings: flowParameters.userSession.userSettings),
navigationStackCoordinator: navigationStackCoordinator,
userIndicatorController: flowParameters.userIndicatorController)
let coordinator = flowParameters.appHooks.userDetailsEditScreenHook.makeCoordinator(parameters: parameters)
@@ -237,16 +237,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
}
private func setupObservers() {
extraTabActions?
.sink { [weak self] action in
switch action {
case .presentRoom(let roomID):
self?.handleAppRoute(.room(roomID: roomID, via: []), animated: true)
case .presentCall(let roomID, let isVoiceCall):
self?.handleAppRoute(.call(roomID: roomID, isVoiceCall: isVoiceCall), animated: true)
}
}
.store(in: &cancellables)
setupExtraTabObserver()
chatsTabFlowCoordinator.actionsPublisher
.sink { [weak self] action in
@@ -358,6 +349,20 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
.store(in: &cancellables)
}
/// HealthChat: routes the Members tab's actions through the normal app-route handling.
private func setupExtraTabObserver() {
extraTabActions?
.sink { [weak self] action in
switch action {
case .presentRoom(let roomID):
self?.handleAppRoute(.room(roomID: roomID, via: []), animated: true)
case .presentCall(let roomID, let isVoiceCall):
self?.handleAppRoute(.call(roomID: roomID, isVoiceCall: isVoiceCall), animated: true)
}
}
.store(in: &cancellables)
}
// MARK: - Onboarding
private func attemptStartingOnboarding() {