refactored the ClientProxy to:

- throw an error during the init
- to have its init directly instantiate the sync service and the providers

Update ElementX/Sources/Services/UserSession/UserSessionStore.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

renamed
This commit is contained in:
Mauro Romito
2025-03-06 12:16:28 +01:00
committed by Mauro
parent 4d01d2aa0b
commit 7373eabffb
10 changed files with 134 additions and 148 deletions
@@ -140,19 +140,19 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo
roomInfo = invitedRoomProxy.info
case .knocked(let knockedRoomProxy):
roomInfo = knockedRoomProxy.info
if let roomSummaryProvider = clientProxy.staticRoomSummaryProvider {
membershipStateChangeCancellable = roomSummaryProvider.roomListPublisher
.compactMap { summaries -> Void? in
guard let roomSummary = summaries.first(where: { $0.id == roomInfo?.id }),
roomSummary.roomListItem.membership() != .knocked else {
return nil
}
return ()
membershipStateChangeCancellable = clientProxy
.staticRoomSummaryProvider
.roomListPublisher
.compactMap { summaries -> Void? in
guard let roomSummary = summaries.first(where: { $0.id == roomInfo?.id }),
roomSummary.roomListItem.membership() != .knocked else {
return nil
}
.sink { [weak self] in
Task { await self?.loadRoomDetails() }
}
}
return ()
}
.sink { [weak self] in
Task { await self?.loadRoomDetails() }
}
case .banned(let bannedRoomProxy):
roomInfo = bannedRoomProxy.info
default: