Reuse the existing room proxy for poll history and avoid an extra subscription

This commit is contained in:
Stefan Ceriu
2024-01-17 11:45:26 +02:00
parent db213a5bf5
commit 922eca0ae5
@@ -872,18 +872,10 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
} }
private func asyncPresentRoomPollsHistory(roomID: String) async { private func asyncPresentRoomPollsHistory(roomID: String) async {
let roomProxy: RoomProxyProtocol guard let roomProxy else {
fatalError()
guard let proxy = await userSession.clientProxy.roomForIdentifier(roomID) else {
MXLog.error("Invalid room identifier: \(roomID)")
stateMachine.tryEvent(.dismissPollsHistory)
return
} }
roomProxy = proxy
await roomProxy.subscribeForUpdates()
let userID = userSession.clientProxy.userID let userID = userSession.clientProxy.userID
let timelineItemFactory = RoomTimelineItemFactory(userID: userID, let timelineItemFactory = RoomTimelineItemFactory(userID: userID,