Move room subscriptions to a separate call, fix side effects when requesting other room data (leaving, inviter etc)

This commit is contained in:
Stefan Ceriu
2023-08-16 15:53:42 +03:00
committed by Stefan Ceriu
parent c64fb44c96
commit 54164b8437
4 changed files with 32 additions and 8 deletions
@@ -282,6 +282,8 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
roomProxy = proxy
}
await roomProxy.subscribeForUpdates()
actionsSubject.send(.presentedRoom(roomID))
self.roomProxy = roomProxy
@@ -369,6 +371,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
private func asyncPresentRoomDetails(roomID: String, isRoot: Bool, animated: Bool) async {
if isRoot {
roomProxy = await userSession.clientProxy.roomForIdentifier(roomID)
await roomProxy?.subscribeForUpdates()
} else {
await asyncPresentRoom(roomID, animated: animated)
}