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
@@ -0,0 +1,23 @@
//
// Copyright 2026 Novaloop AG
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import SwiftUI
#if IS_MAIN_APP
/// Builds the HealthChat session-scoped hooks when a user session is created.
nonisolated struct HealthChatUserSessionHook: UserSessionHookProtocol {
func makeUserHooks(for clientProxy: ClientProxyProtocol) -> UserHooks {
let apiService = HealthChatAPIService(tokenProvider: HealthChatOpenIDTokenProvider(clientProxy: clientProxy))
return UserHooks(extendedProfileSectionHook: HealthChatExtendedProfileSectionHook(extendedProfileService: ExtendedProfileService(clientProxy: clientProxy)),
settingsScreenHook: HealthChatSettingsScreenHook(statusLoader: HealthChatAccountStatusLoader(apiService: apiService)))
}
func configure(_ userSettings: UserSettings, forHomeserver homeserver: String) -> UserSettings {
userSettings
}
}
#endif