diff --git a/ElementX/Sources/FlowCoordinators/ChatsTabFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/ChatsTabFlowCoordinator.swift index d815cb43d..6c94808bf 100644 --- a/ElementX/Sources/FlowCoordinators/ChatsTabFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/ChatsTabFlowCoordinator.swift @@ -478,6 +478,7 @@ class ChatsTabFlowCoordinator: FlowCoordinatorProtocol { guard case let .joined(roomProxy) = await userSession.clientProxy.roomForIdentifier(roomID) else { return } + // The screen requires listening to the membership state changes await roomProxy.subscribeForUpdates() let parameters = RoomChangeRolesScreenCoordinatorParameters(mode: .owner, diff --git a/ElementX/Sources/FlowCoordinators/SpaceFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/SpaceFlowCoordinator.swift index 488a147e6..77c2fd4fd 100644 --- a/ElementX/Sources/FlowCoordinators/SpaceFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/SpaceFlowCoordinator.swift @@ -55,6 +55,8 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { case space /// The user is adding rooms to the space. case addingRooms + /// The user is transferring their ownership of the space. + case transferOwnership /// A child (space) flow is in progress. case presentingChild(childSpaceID: String, previousState: State) /// A room flow is in progress @@ -69,11 +71,9 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { case createChildRoomFlow case leftSpace - - case transferOwnership } - enum Event: EventType, Equatable, Hashable { + enum Event: EventType { /// The flow is being started. case start /// The flow is being started for an unjoined space. @@ -89,6 +89,11 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { /// The user finished adding rooms to this space. case dismissedAddRooms + /// Allow the user to transfer their ownership of the space. + case presentTransferOwnership + /// The user finished transferring their ownership of the space. + case dismissedTransferOwnership + /// Request the presentation of a child space flow. /// /// The space's `SpaceRoomListProxyProtocol` must be provided in the `userInfo`. @@ -110,9 +115,6 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { case startCreateChildRoomFlow case stopCreateChildRoomFlow - - case presentTransferOwnership - case dismissedTransferOwnership } private let stateMachine: StateMachine @@ -166,6 +168,9 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { case .addingRooms: navigationStackCoordinator.setSheetCoordinator(nil) clearRoute(animated: animated) // Re-run with the state machine back in the .space state. + case .transferOwnership: + navigationStackCoordinator.setSheetCoordinator(nil) + clearRoute(animated: animated) // Re-run with the state machine back in the .space state. case .presentingChild: childSpaceFlowCoordinator?.clearRoute(animated: animated) clearRoute(animated: animated) // Re-run with the state machine back in the .space state. @@ -184,9 +189,6 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol { case .createChildRoomFlow: navigationStackCoordinator.setSheetCoordinator(nil) clearRoute(animated: animated) // Re-run with the state machine back in the .space state. - case .transferOwnership: - navigationStackCoordinator.setSheetCoordinator(nil) - clearRoute(animated: animated) // Re-run with the state machine back in the .space state. } } diff --git a/ElementX/Sources/FlowCoordinators/SpaceSettingsFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/SpaceSettingsFlowCoordinator.swift index 75315efac..e3bfed49d 100644 --- a/ElementX/Sources/FlowCoordinators/SpaceSettingsFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/SpaceSettingsFlowCoordinator.swift @@ -27,16 +27,16 @@ final class SpaceSettingsFlowCoordinator: FlowCoordinatorProtocol { case securityAndPrivacy /// The edit address screen case editAddress + /// The manage authorized spaces screen + case manageAuthorizedSpacesScreen + /// The screen that allows a user to transfer their ownership of the space. + case transferOwnership /// Other flows /// The roles and permissions screen case rolesAndPermissionsFlow /// The members flow screen case membersFlow - - case manageAuthorizedSpacesScreen - - case transferOwnership } enum Event: EventType { @@ -53,18 +53,18 @@ final class SpaceSettingsFlowCoordinator: FlowCoordinatorProtocol { case presentEditAddress case dismissedEditAddress + case presentManageAuthorizedSpacesScreen + case dismissedManageAuthorizedSpacesScreen + + case presentTransferOwnership + case dismissedTransferOwnership + // Other flows case startMembersListFlow case stopMembersListFlow case startRolesAndPermissionsFlow case stopRolesAndPermissionsFlow - - case presentManageAuthorizedSpacesScreen - case dismissedManageAuthorizedSpacesScreen - - case presentTransferOwnership - case dismissedTransferOwnership } private let roomProxy: JoinedRoomProxyProtocol