mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
pr suggestions
This commit is contained in:
@@ -18,7 +18,7 @@ struct HomeScreenInviteCell: View {
|
||||
let hideInviteAvatars: Bool
|
||||
|
||||
private var avatar: RoomAvatar {
|
||||
hideInviteAvatars ? .room(id: room.id, name: room.name, avatarURL: nil) : room.avatar
|
||||
hideInviteAvatars ? room.avatar.removingAvatar : room.avatar
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
@@ -156,7 +156,7 @@ struct HomeScreenInviteCell_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
HomeScreenInviteCell(room: .roomInvite(alias: "#footest:somewhere.org", avatarURL: .mockMXCAvatar),
|
||||
context: viewModel().context, hideInviteAvatars: false)
|
||||
HomeScreenInviteCell(room: .roomInvite(alias: "#footest:somewhere.org", avatarURL: .mockMXCAvatar),
|
||||
HomeScreenInviteCell(room: .roomInvite(alias: "#footest-hidden-avatars:somewhere.org", avatarURL: .mockMXCAvatar),
|
||||
context: viewModel(hideInviteAvatars: true).context, hideInviteAvatars: true)
|
||||
HomeScreenInviteCell(room: .roomInvite(alias: "#footest:somewhere.org"),
|
||||
context: viewModel().context, hideInviteAvatars: false)
|
||||
|
||||
@@ -82,10 +82,11 @@ struct JoinRoomScreenViewState: BindableState {
|
||||
}
|
||||
|
||||
var avatar: RoomAvatar? {
|
||||
// DM invites avatars are broken, this is a workaround
|
||||
if isDMInvite, let inviter = roomDetails?.inviter {
|
||||
return .room(id: roomID, name: inviter.displayName, avatarURL: hideInviteAvatars ? nil : inviter.avatarURL)
|
||||
} else if let roomDetails, let avatar = roomDetails.avatar {
|
||||
return shouldHideAvatars ? .room(id: roomID, name: roomDetails.name, avatarURL: nil) : avatar
|
||||
return shouldHideAvatars ? avatar.removingAvatar : avatar
|
||||
} else if let name = roomDetails?.name {
|
||||
return .room(id: roomID, name: name, avatarURL: nil)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user