pr suggestions

This commit is contained in:
Mauro Romito
2026-01-28 15:10:59 +01:00
committed by Mauro
parent 8f6506ced0
commit 9edb7fd7ff
3 changed files with 22 additions and 19 deletions
@@ -478,6 +478,7 @@ class ChatsTabFlowCoordinator: FlowCoordinatorProtocol {
guard case let .joined(roomProxy) = await userSession.clientProxy.roomForIdentifier(roomID) else { guard case let .joined(roomProxy) = await userSession.clientProxy.roomForIdentifier(roomID) else {
return return
} }
// The screen requires listening to the membership state changes
await roomProxy.subscribeForUpdates() await roomProxy.subscribeForUpdates()
let parameters = RoomChangeRolesScreenCoordinatorParameters(mode: .owner, let parameters = RoomChangeRolesScreenCoordinatorParameters(mode: .owner,
@@ -55,6 +55,8 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
case space case space
/// The user is adding rooms to the space. /// The user is adding rooms to the space.
case addingRooms case addingRooms
/// The user is transferring their ownership of the space.
case transferOwnership
/// A child (space) flow is in progress. /// A child (space) flow is in progress.
case presentingChild(childSpaceID: String, previousState: State) case presentingChild(childSpaceID: String, previousState: State)
/// A room flow is in progress /// A room flow is in progress
@@ -69,11 +71,9 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
case createChildRoomFlow case createChildRoomFlow
case leftSpace case leftSpace
case transferOwnership
} }
enum Event: EventType, Equatable, Hashable { enum Event: EventType {
/// The flow is being started. /// The flow is being started.
case start case start
/// The flow is being started for an unjoined space. /// The flow is being started for an unjoined space.
@@ -89,6 +89,11 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
/// The user finished adding rooms to this space. /// The user finished adding rooms to this space.
case dismissedAddRooms 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. /// Request the presentation of a child space flow.
/// ///
/// The space's `SpaceRoomListProxyProtocol` must be provided in the `userInfo`. /// The space's `SpaceRoomListProxyProtocol` must be provided in the `userInfo`.
@@ -110,9 +115,6 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
case startCreateChildRoomFlow case startCreateChildRoomFlow
case stopCreateChildRoomFlow case stopCreateChildRoomFlow
case presentTransferOwnership
case dismissedTransferOwnership
} }
private let stateMachine: StateMachine<State, Event> private let stateMachine: StateMachine<State, Event>
@@ -166,6 +168,9 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
case .addingRooms: case .addingRooms:
navigationStackCoordinator.setSheetCoordinator(nil) navigationStackCoordinator.setSheetCoordinator(nil)
clearRoute(animated: animated) // Re-run with the state machine back in the .space state. 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: case .presentingChild:
childSpaceFlowCoordinator?.clearRoute(animated: animated) childSpaceFlowCoordinator?.clearRoute(animated: animated)
clearRoute(animated: animated) // Re-run with the state machine back in the .space state. clearRoute(animated: animated) // Re-run with the state machine back in the .space state.
@@ -184,9 +189,6 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
case .createChildRoomFlow: case .createChildRoomFlow:
navigationStackCoordinator.setSheetCoordinator(nil) navigationStackCoordinator.setSheetCoordinator(nil)
clearRoute(animated: animated) // Re-run with the state machine back in the .space state. 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.
} }
} }
@@ -27,16 +27,16 @@ final class SpaceSettingsFlowCoordinator: FlowCoordinatorProtocol {
case securityAndPrivacy case securityAndPrivacy
/// The edit address screen /// The edit address screen
case editAddress 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 /// Other flows
/// The roles and permissions screen /// The roles and permissions screen
case rolesAndPermissionsFlow case rolesAndPermissionsFlow
/// The members flow screen /// The members flow screen
case membersFlow case membersFlow
case manageAuthorizedSpacesScreen
case transferOwnership
} }
enum Event: EventType { enum Event: EventType {
@@ -53,18 +53,18 @@ final class SpaceSettingsFlowCoordinator: FlowCoordinatorProtocol {
case presentEditAddress case presentEditAddress
case dismissedEditAddress case dismissedEditAddress
case presentManageAuthorizedSpacesScreen
case dismissedManageAuthorizedSpacesScreen
case presentTransferOwnership
case dismissedTransferOwnership
// Other flows // Other flows
case startMembersListFlow case startMembersListFlow
case stopMembersListFlow case stopMembersListFlow
case startRolesAndPermissionsFlow case startRolesAndPermissionsFlow
case stopRolesAndPermissionsFlow case stopRolesAndPermissionsFlow
case presentManageAuthorizedSpacesScreen
case dismissedManageAuthorizedSpacesScreen
case presentTransferOwnership
case dismissedTransferOwnership
} }
private let roomProxy: JoinedRoomProxyProtocol private let roomProxy: JoinedRoomProxyProtocol