mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
feat: decline and block screen
fix improvement fix conflict fix tests tests
This commit is contained in:
@@ -20,6 +20,7 @@ struct JoinRoomScreenCoordinatorParameters {
|
||||
enum JoinRoomScreenCoordinatorAction {
|
||||
case joined
|
||||
case cancelled
|
||||
case presentDeclineAndBlock(userID: String)
|
||||
}
|
||||
|
||||
final class JoinRoomScreenCoordinator: CoordinatorProtocol {
|
||||
@@ -51,6 +52,8 @@ final class JoinRoomScreenCoordinator: CoordinatorProtocol {
|
||||
actionsSubject.send(.joined)
|
||||
case .dismiss:
|
||||
actionsSubject.send(.cancelled)
|
||||
case .presentDeclineAndBlock(let userID):
|
||||
actionsSubject.send(.presentDeclineAndBlock(userID: userID))
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
enum JoinRoomScreenViewModelAction {
|
||||
enum JoinRoomScreenViewModelAction: Equatable {
|
||||
case joined
|
||||
case dismiss
|
||||
case presentDeclineAndBlock(userID: String)
|
||||
}
|
||||
|
||||
enum JoinRoomScreenMode: Equatable {
|
||||
|
||||
@@ -323,11 +323,15 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo
|
||||
}
|
||||
|
||||
private func showDeclineAndBlockConfirmationAlert(userID: String) {
|
||||
state.bindings.alertInfo = .init(id: .declineInviteAndBlock,
|
||||
title: L10n.screenJoinRoomDeclineAndBlockAlertTitle,
|
||||
message: L10n.screenJoinRoomDeclineAndBlockAlertMessage(userID),
|
||||
primaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil),
|
||||
secondaryButton: .init(title: L10n.screenJoinRoomDeclineAndBlockAlertConfirmation, role: .destructive) { Task { await self.declineAndBlock(userID: userID) } })
|
||||
if appSettings.reportInviteEnabled {
|
||||
actionsSubject.send(.presentDeclineAndBlock(userID: userID))
|
||||
} else {
|
||||
state.bindings.alertInfo = .init(id: .declineInviteAndBlock,
|
||||
title: L10n.screenJoinRoomDeclineAndBlockAlertTitle,
|
||||
message: L10n.screenJoinRoomDeclineAndBlockAlertMessage(userID),
|
||||
primaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil),
|
||||
secondaryButton: .init(title: L10n.screenJoinRoomDeclineAndBlockAlertConfirmation, role: .destructive) { Task { await self.declineAndBlock(userID: userID) } })
|
||||
}
|
||||
}
|
||||
|
||||
private func declineAndBlock(userID: String) async {
|
||||
|
||||
Reference in New Issue
Block a user