Эх сурвалжийг харах

Merge pull request #1059 from deltachat/fix_send_button_state_4_video_drafts

fix send button state after video draft has been added
bjoern 4 жил өмнө
parent
commit
db0deb7901

+ 2 - 0
deltachat-ios/Chat/Views/MediaPreview.swift

@@ -52,6 +52,7 @@ class MediaPreview: DraftPreview {
             if let image = ThumbnailCache.shared.restoreImage(key: path) {
             if let image = ThumbnailCache.shared.restoreImage(key: path) {
                 self.contentImageView.image = image
                 self.contentImageView.image = image
                 self.setAspectRatio(image: image)
                 self.setAspectRatio(image: image)
+                self.delegate?.onAttachmentAdded()
             } else {
             } else {
                 DispatchQueue.global(qos: .userInteractive).async {
                 DispatchQueue.global(qos: .userInteractive).async {
                     let thumbnailImage = DcUtils.generateThumbnailFromVideo(url: URL(fileURLWithPath: path, isDirectory: false))
                     let thumbnailImage = DcUtils.generateThumbnailFromVideo(url: URL(fileURLWithPath: path, isDirectory: false))
@@ -61,6 +62,7 @@ class MediaPreview: DraftPreview {
                             self.contentImageView.image = thumbnailImage
                             self.contentImageView.image = thumbnailImage
                             self.setAspectRatio(image: thumbnailImage)
                             self.setAspectRatio(image: thumbnailImage)
                             ThumbnailCache.shared.storeImage(image: thumbnailImage, key: path)
                             ThumbnailCache.shared.storeImage(image: thumbnailImage, key: path)
+                            self.delegate?.onAttachmentAdded()
                         }
                         }
                     }
                     }
                 }
                 }