mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Bottom Sheet to confirm DM creation (#3739)
* created the view to hold the bottom sheet * added the sheet to the start chat screen * switched the alert with the bottom sheet in the room member details * add a small delay to not always show the loader * suggested PR changes * pr suggestions and updated tests
This commit is contained in:
+3
-6
@@ -71,6 +71,8 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro
|
||||
Task { await displayFullScreenAvatar(url) }
|
||||
case .openDirectChat:
|
||||
Task { await openDirectChat() }
|
||||
case .createDirectChat:
|
||||
Task { await createDirectChat() }
|
||||
case .startCall(let roomID):
|
||||
actionsSubject.send(.startCall(roomID: roomID))
|
||||
}
|
||||
@@ -187,12 +189,7 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro
|
||||
if let roomID {
|
||||
actionsSubject.send(.openDirectChat(roomID: roomID))
|
||||
} else {
|
||||
let string = roomMemberProxy.displayName ?? roomMemberProxy.userID
|
||||
state.bindings.alertInfo = .init(id: .createDirectChatConfirmation,
|
||||
title: L10n.screenRoomMemberDetailsAlertCreateDmTitle,
|
||||
message: L10n.screenRoomMemberDetailsAlertCreateDmMessage(string),
|
||||
primaryButton: .init(title: L10n.screenRoomMemberDetailsAlertCreateDmConfirmationTitle) { [weak self] in Task { await self?.createDirectChat() }},
|
||||
secondaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil))
|
||||
state.bindings.inviteConfirmationUser = .init(userID: roomMemberProxy.userID, displayName: roomMemberProxy.displayName, avatarURL: roomMemberProxy.avatarURL)
|
||||
}
|
||||
case .failure:
|
||||
state.bindings.alertInfo = .init(id: .failedOpeningDirectChat)
|
||||
|
||||
Reference in New Issue
Block a user