소스 검색

fix avatar view shown wrongly on recycled views

cyberta 4 년 전
부모
커밋
0b49807e18
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

+ 3 - 1
deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

@@ -135,7 +135,10 @@ public class BaseMessageCell: UITableViewCell {
             if let profileImage = msg.fromContact.profileImage {
                 avatarView.setImage(profileImage)
             }
+        } else {
+            avatarView.isHidden = true
         }
+
         messageBackgroundContainer.update(rectCorners: messageStyle,
                                           color: msg.isFromCurrentSender ? DcColors.messagePrimaryColor : DcColors.messageSecondaryColor)
 
@@ -222,7 +225,6 @@ public class BaseMessageCell: UITableViewCell {
         topLabel.text = nil
         topLabel.attributedText = nil
         avatarView.reset()
-        avatarView.isHidden = true
         messageBackgroundContainer.prepareForReuse()
         bottomLabel.text = nil
         bottomLabel.attributedText = nil