Fix display name bug

pull/275/head
nielsandriesse 5 years ago
parent f86ad16767
commit 7596c100a3

@ -5,7 +5,7 @@ final class GroupMembersVC : BaseVC, UITableViewDataSource {
private lazy var members: [String] = {
func getDisplayName(for hexEncodedPublicKey: String) -> String {
return UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? "Unknown Contact"
return UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? hexEncodedPublicKey
}
return GroupUtilities.getClosedGroupMembers(thread).sorted { getDisplayName(for: $0) < getDisplayName(for: $1) }
}()
@ -150,7 +150,7 @@ private extension GroupMembersVC {
private func update() {
profilePictureView.hexEncodedPublicKey = hexEncodedPublicKey
profilePictureView.update()
displayNameLabel.text = UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? "Unknown Contact"
displayNameLabel.text = UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? hexEncodedPublicKey
}
}
}

@ -17,7 +17,7 @@ final class NewClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelegat
}
}
func getDisplayName(for hexEncodedPublicKey: String) -> String {
return UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? "Unknown Contact"
return UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? hexEncodedPublicKey
}
let userPublicKey = getUserHexEncodedPublicKey()
var userLinkedDevices: Set<String> = [ userPublicKey ]
@ -338,7 +338,7 @@ private extension NewClosedGroupVC {
private func update() {
profilePictureView.hexEncodedPublicKey = hexEncodedPublicKey
profilePictureView.update()
displayNameLabel.text = UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? "Unknown Contact"
displayNameLabel.text = UserDisplayNameUtilities.getPrivateChatDisplayName(for: hexEncodedPublicKey) ?? hexEncodedPublicKey
let icon = hasTick ? #imageLiteral(resourceName: "CircleCheck") : #imageLiteral(resourceName: "Circle")
tickImageView.image = icon.asTintedImage(color: Colors.text)!
}

Loading…
Cancel
Save