mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Report room and decline & block screens tweaks (#4044)
* report rom and decline and block screens tweaks - Use the copies: "Leave room" and "Report room" everywhere, also in DMs - Report reason in report room is now mandatory. - Report reason in decline and block is now mandatory if the report action is set to on. - Generic alert for failure of main API in both report room and decline and block has been added * report room and decline and block screen previews
This commit is contained in:
@@ -38,7 +38,7 @@ class ReportRoomScreenViewModel: ReportRoomScreenViewModelType, ReportRoomScreen
|
||||
|
||||
private func report() async {
|
||||
showLoadingIndicator()
|
||||
let result = await roomProxy.reportRoom(reason: state.bindings.reason.isBlank ? nil : state.bindings.reason)
|
||||
let result = await roomProxy.reportRoom(reason: state.bindings.reason.isEmpty ? nil : state.bindings.reason)
|
||||
|
||||
switch result {
|
||||
case .success:
|
||||
@@ -51,7 +51,11 @@ class ReportRoomScreenViewModel: ReportRoomScreenViewModelType, ReportRoomScreen
|
||||
}
|
||||
case .failure:
|
||||
hideLoadingIndicator()
|
||||
userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown))
|
||||
state.bindings.alert = .init(id: .reportRoomFailed,
|
||||
title: L10n.commonSomethingWentWrong,
|
||||
message: L10n.commonSomethingWentWrongMessage,
|
||||
primaryButton: .init(title: L10n.actionDismiss, role: .cancel, action: nil),
|
||||
secondaryButton: .init(title: L10n.actionTryAgain) { [weak self] in Task { await self?.report() } })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +76,7 @@ class ReportRoomScreenViewModel: ReportRoomScreenViewModelType, ReportRoomScreen
|
||||
title: L10n.screenReportRoomLeaveFailedAlertTitle,
|
||||
message: L10n.screenReportRoomLeaveFailedAlertMessage,
|
||||
primaryButton: .init(title: L10n.actionDismiss, role: .cancel) { [weak self] in self?.actionsSubject.send(.dismiss(shouldLeaveRoom: false)) },
|
||||
secondaryButton: .init(title: L10n.actionRetry) { [weak self] in Task { await self?.leaveRoom(showLoading: true) } })
|
||||
secondaryButton: .init(title: L10n.actionTryAgain) { [weak self] in Task { await self?.leaveRoom(showLoading: true) } })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user