mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add RoomDetails for use (with RoomMemberDetails) in AvatarHeaderView. (#2490)
* Add RoomDetails and refactor AvatarHeaderView to use it. * Remove old displayName property and use RoomDetails in the RoomDetailsScreenViewState
This commit is contained in:
@@ -436,12 +436,12 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
}
|
||||
|
||||
if room.isPublic {
|
||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .public)
|
||||
state.bindings.leaveRoomAlertItem = LeaveRoomAlertItem(roomID: roomId, isDM: room.isEncryptedOneToOneRoom, state: .public)
|
||||
} else {
|
||||
state.bindings.leaveRoomAlertItem = if room.joinedMembersCount > 1 {
|
||||
LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .private)
|
||||
LeaveRoomAlertItem(roomID: roomId, isDM: room.isEncryptedOneToOneRoom, state: .private)
|
||||
} else {
|
||||
LeaveRoomAlertItem(roomId: roomId, isDM: room.isEncryptedOneToOneRoom, state: .empty)
|
||||
LeaveRoomAlertItem(roomID: roomId, isDM: room.isEncryptedOneToOneRoom, state: .empty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ struct HomeScreen: View {
|
||||
private func leaveRoomAlertActions(_ item: LeaveRoomAlertItem) -> some View {
|
||||
Button(item.cancelTitle, role: .cancel) { }
|
||||
Button(item.confirmationTitle, role: .destructive) {
|
||||
context.send(viewAction: .confirmLeaveRoom(roomIdentifier: item.roomId))
|
||||
context.send(viewAction: .confirmLeaveRoom(roomIdentifier: item.roomID))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user