mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Re-organise SettingsScreen to have distinct Account/App settings. (#6288)
* Re-organise SettingsScreen to have distinct Account/App settings. * Remove the AdvancedSettingsScreen.
This commit is contained in:
+22
@@ -13,12 +13,34 @@ struct ModerationAndSafetySettingsScreenCoordinatorParameters {
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
}
|
||||
|
||||
enum ModerationAndSafetySettingsScreenCoordinatorAction {
|
||||
case blockedUsers
|
||||
}
|
||||
|
||||
final class ModerationAndSafetySettingsScreenCoordinator: CoordinatorProtocol {
|
||||
private var viewModel: ModerationAndSafetySettingsScreenViewModelProtocol
|
||||
|
||||
private let actionsSubject: PassthroughSubject<ModerationAndSafetySettingsScreenCoordinatorAction, Never> = .init()
|
||||
var actionsPublisher: AnyPublisher<ModerationAndSafetySettingsScreenCoordinatorAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
init(parameters: ModerationAndSafetySettingsScreenCoordinatorParameters) {
|
||||
viewModel = ModerationAndSafetySettingsScreenViewModel(userSession: parameters.userSession,
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
|
||||
viewModel.actionsPublisher
|
||||
.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
|
||||
switch action {
|
||||
case .blockedUsers:
|
||||
actionsSubject.send(.blockedUsers)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
|
||||
Reference in New Issue
Block a user