Add hooks for the RoomDetails, RoomMemberDetails and UserProfile screens. (#5980)

Also adds an @AppHook macro.
This commit is contained in:
Doug
2026-08-05 12:41:18 +01:00
committed by GitHub
parent 68f7f2b301
commit 80530f0006
31 changed files with 328 additions and 126 deletions
@@ -14,8 +14,8 @@ typealias UserProfileScreenViewModelType = StateStoreViewModelV2<UserProfileScre
class UserProfileScreenViewModel: UserProfileScreenViewModelType, UserProfileScreenViewModelProtocol {
private let userSession: UserSessionProtocol
private let userIndicatorController: UserIndicatorControllerProtocol
private let analytics: AnalyticsServiceProtocol
private let userIndicatorController: UserIndicatorControllerProtocol
private var actionsSubject: PassthroughSubject<UserProfileScreenViewModelAction, Never> = .init()
var actionsPublisher: AnyPublisher<UserProfileScreenViewModelAction, Never> {
@@ -25,18 +25,20 @@ class UserProfileScreenViewModel: UserProfileScreenViewModelType, UserProfileScr
init(userID: String,
isPresentedModally: Bool,
userSession: UserSessionProtocol,
userIndicatorController: UserIndicatorControllerProtocol,
analytics: AnalyticsServiceProtocol) {
appHooks: AppHooks,
analytics: AnalyticsServiceProtocol,
userIndicatorController: UserIndicatorControllerProtocol) {
self.userSession = userSession
self.userIndicatorController = userIndicatorController
self.analytics = analytics
self.userIndicatorController = userIndicatorController
let initialViewState = UserProfileScreenViewState(userID: userID,
isOwnUser: userID == userSession.clientProxy.userID,
isPresentedModally: isPresentedModally,
bindings: .init())
super.init(initialViewState: initialViewState, mediaProvider: userSession.mediaProvider)
super.init(initialViewState: appHooks.userProfileScreenHook.update(initialViewState),
mediaProvider: userSession.mediaProvider)
showLoadingIndicator(allowsInteraction: true)
Task {