From 922eca0ae568b1f57f27904efc96b5b873c1ae19 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 17 Jan 2024 11:45:26 +0200 Subject: [PATCH] Reuse the existing room proxy for poll history and avoid an extra subscription --- .../FlowCoordinators/RoomFlowCoordinator.swift | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 25beb9bc7..12c12a918 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -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