mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 19:34:25 +02:00
+14
-17
@@ -23,6 +23,7 @@ enum RoomSuggestionCoordinatorCoordinatorAction {
|
||||
}
|
||||
|
||||
@objcMembers
|
||||
@available(iOS 14.0, *)
|
||||
final class RoomSuggestionCoordinator: Coordinator {
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -52,21 +53,19 @@ final class RoomSuggestionCoordinator: Coordinator {
|
||||
|
||||
|
||||
func start() {
|
||||
if #available(iOS 14.0, *) {
|
||||
MXLog.debug("[RoomAccessCoordinator] did start.")
|
||||
let rootCoordinator = self.createRoomSuggestionSpaceChooser()
|
||||
rootCoordinator.start()
|
||||
|
||||
self.add(childCoordinator: rootCoordinator)
|
||||
|
||||
if self.navigationRouter.modules.isEmpty == false {
|
||||
self.navigationRouter.push(rootCoordinator, animated: true, popCompletion: { [weak self] in
|
||||
self?.remove(childCoordinator: rootCoordinator)
|
||||
})
|
||||
} else {
|
||||
self.navigationRouter.setRootModule(rootCoordinator) { [weak self] in
|
||||
self?.remove(childCoordinator: rootCoordinator)
|
||||
}
|
||||
MXLog.debug("[RoomSuggestionCoordinator] did start.")
|
||||
let rootCoordinator = self.createRoomSuggestionSpaceChooser()
|
||||
rootCoordinator.start()
|
||||
|
||||
self.add(childCoordinator: rootCoordinator)
|
||||
|
||||
if self.navigationRouter.modules.isEmpty == false {
|
||||
self.navigationRouter.push(rootCoordinator, animated: true, popCompletion: { [weak self] in
|
||||
self?.remove(childCoordinator: rootCoordinator)
|
||||
})
|
||||
} else {
|
||||
self.navigationRouter.setRootModule(rootCoordinator) { [weak self] in
|
||||
self?.remove(childCoordinator: rootCoordinator)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,7 +76,6 @@ final class RoomSuggestionCoordinator: Coordinator {
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
func pushScreen(with coordinator: Coordinator & Presentable) {
|
||||
add(childCoordinator: coordinator)
|
||||
|
||||
@@ -88,7 +86,6 @@ final class RoomSuggestionCoordinator: Coordinator {
|
||||
coordinator.start()
|
||||
}
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
private func createRoomSuggestionSpaceChooser() -> MatrixItemChooserCoordinator {
|
||||
let paramaters = MatrixItemChooserCoordinatorParameters(
|
||||
session: parameters.room.mxSession,
|
||||
|
||||
+3
@@ -15,6 +15,7 @@
|
||||
//
|
||||
import UIKit
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
@objc protocol RoomSuggestionCoordinatorBridgePresenterDelegate {
|
||||
func roomSuggestionCoordinatorBridgePresenterDelegateDidCancel(_ coordinatorBridgePresenter: RoomSuggestionCoordinatorBridgePresenter)
|
||||
func roomSuggestionCoordinatorBridgePresenterDelegateDidComplete(_ coordinatorBridgePresenter: RoomSuggestionCoordinatorBridgePresenter)
|
||||
@@ -25,6 +26,7 @@ import UIKit
|
||||
/// It breaks the Coordinator abstraction and it has been introduced for Objective-C compatibility (mainly for integration in legacy view controllers).
|
||||
/// Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator.
|
||||
@objcMembers
|
||||
@available(iOS 14.0, *)
|
||||
final class RoomSuggestionCoordinatorBridgePresenter: NSObject {
|
||||
|
||||
// MARK: - Properties
|
||||
@@ -85,6 +87,7 @@ final class RoomSuggestionCoordinatorBridgePresenter: NSObject {
|
||||
|
||||
// MARK: - UIAdaptivePresentationControllerDelegate
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
extension RoomSuggestionCoordinatorBridgePresenter: UIAdaptivePresentationControllerDelegate {
|
||||
|
||||
func roomNotificationSettingsCoordinatorDidComplete(_ presentationController: UIPresentationController) {
|
||||
|
||||
+2
@@ -99,6 +99,8 @@ class RoomSuggestionSpaceChooserItemsProcessor: MatrixItemChooserProcessorProtoc
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
/// (Un)suggest room for spaces which ID is in `parentIds`.
|
||||
/// Recurse to the next index once done.
|
||||
private func setRoom(suggested: Bool, forParentsWithId parentIds: [String], at index: Int = 0, completion: @escaping () -> Void) {
|
||||
guard index < parentIds.count else {
|
||||
completion()
|
||||
|
||||
Reference in New Issue
Block a user