mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 19:34:25 +02:00
pr suggestions
This commit is contained in:
@@ -139,21 +139,20 @@ class RoomContextActionService: NSObject, RoomContextActionServiceProtocol {
|
||||
|
||||
Task {
|
||||
if try await room.isLastOwner() {
|
||||
let alertController = await UIAlertController(title: VectorL10n.error, message: VectorL10n.roomParticipantsLeaveNotAllowedForLastOwnerMsg, preferredStyle: .alert)
|
||||
await alertController.addAction(UIAlertAction(title: VectorL10n.ok, style: .cancel, handler: nil))
|
||||
await MainActor.run {
|
||||
let alertController = UIAlertController(title: VectorL10n.error, message: VectorL10n.roomParticipantsLeaveNotAllowedForLastOwnerMsg, preferredStyle: .alert)
|
||||
alertController.addAction(UIAlertAction(title: VectorL10n.ok, style: .cancel, handler: nil))
|
||||
self.delegate?.roomContextActionService(self, presentAlert: alertController)
|
||||
}
|
||||
} else {
|
||||
let title = room.isDirect ? VectorL10n.roomParticipantsLeavePromptTitleForDm : VectorL10n.roomParticipantsLeavePromptTitle
|
||||
let message = room.isDirect ? VectorL10n.roomParticipantsLeavePromptMsgForDm : VectorL10n.roomParticipantsLeavePromptMsg
|
||||
|
||||
let alertController = await UIAlertController(title: title, message: message, preferredStyle: .alert)
|
||||
await alertController.addAction(UIAlertAction(title: VectorL10n.cancel, style: .cancel, handler: nil))
|
||||
await alertController.addAction(UIAlertAction(title: VectorL10n.leave, style: .default, handler: { action in
|
||||
self.leaveRoom()
|
||||
}))
|
||||
await MainActor.run {
|
||||
let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
|
||||
alertController.addAction(UIAlertAction(title: VectorL10n.cancel, style: .cancel, handler: nil))
|
||||
alertController.addAction(UIAlertAction(title: VectorL10n.leave, style: .default, handler: { [weak self] action in
|
||||
self?.leaveRoom()
|
||||
}))
|
||||
self.delegate?.roomContextActionService(self, presentAlert: alertController)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user