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,17 +872,9 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
}
private func asyncPresentRoomPollsHistory(roomID: String) async {
let roomProxy: RoomProxyProtocol
guard let proxy = await userSession.clientProxy.roomForIdentifier(roomID) else {
MXLog.error("Invalid room identifier: \(roomID)")
stateMachine.tryEvent(.dismissPollsHistory)
return
guard let roomProxy else {
fatalError()
}
roomProxy = proxy
await roomProxy.subscribeForUpdates()
let userID = userSession.clientProxy.userID