瀏覽代碼

always load images asynchronously in ImageTextCell, improves scrolling

cyberta 4 年之前
父節點
當前提交
9c3c30b3ca
共有 1 個文件被更改,包括 2 次插入6 次删除
  1. 2 6
      deltachat-ios/Chat/Views/Cells/ImageTextCell.swift

+ 2 - 6
deltachat-ios/Chat/Views/Cells/ImageTextCell.swift

@@ -50,7 +50,8 @@ class ImageTextCell: BaseMessageCell {
         tag = msg.id
 
         if let url = msg.fileURL,
-           ((msg.type == DC_MSG_GIF) ||
+           ((msg.type == DC_MSG_IMAGE) ||
+            (msg.type == DC_MSG_GIF) ||
                 msg.type == DC_MSG_STICKER ||
                 (msg.type == DC_MSG_IMAGE && url.pathExtension == "webp")) {
             contentImageView.sd_setImage(with: url,
@@ -62,11 +63,6 @@ class ImageTextCell: BaseMessageCell {
             playButtonView.isHidden = true
             accessibilityLabel = msg.type == DC_MSG_GIF ? String.localized("gif") : String.localized("image")
             setAspectRatioFor(message: msg)
-        } else if msg.type == DC_MSG_IMAGE, let image = msg.image {
-            contentImageView.image = image
-            accessibilityLabel = String.localized("image")
-            playButtonView.isHidden = true
-            setAspectRatioFor(message: msg)
         } else if msg.type == DC_MSG_VIDEO, let url = msg.fileURL {
             playButtonView.isHidden = false
             accessibilityLabel = String.localized("video")