reset backup image color if there's an avatar image
@@ -150,6 +150,7 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
cell.nameLabel.text = chat.name
if let img = chat.profileImage {
+ cell.resetBackupImage()
cell.setImage(img)
} else {
cell.setBackupImage(name: chat.name, color: chat.color)
@@ -172,6 +172,11 @@ class ContactCell: UITableViewCell {
}
+ func resetBackupImage() {
+ initialsLabel.text = ""
+ setColor(UIColor.clear)
+ }
+
func setBackupImage(name: String, color: UIColor) {
let text = Utils.getInitials(inputName: name)