Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent c7582b6bd7
commit 82fb766c27

@ -81,7 +81,7 @@ public class ConversationMediaView: UIView {
return
}
guard let progress = attachmentDownloads.downloadProgress(forAttachmentId: attachmentId) else {
guard nil != attachmentDownloads.downloadProgress(forAttachmentId: attachmentId) else {
// Not being downloaded.
configureForMissingOrInvalid()
return
@ -94,7 +94,7 @@ public class ConversationMediaView: UIView {
}
private func addUploadProgressIfNecessary(_ subview: UIView,
progressCallback: @escaping ProgressCallback) {
progressCallback: ProgressCallback? = nil) {
guard isOutgoing else {
return
}
@ -105,8 +105,10 @@ public class ConversationMediaView: UIView {
return
}
let uploadView = AttachmentUploadView(attachment: attachmentStream) { (isAttachmentReady) in
if let progressCallback = progressCallback {
progressCallback(isAttachmentReady)
}
}
subview.addSubview(uploadView)
uploadView.autoPinEdgesToSuperviewEdges()
}
@ -127,8 +129,8 @@ public class ConversationMediaView: UIView {
animatedImageView.backgroundColor = Theme.offBackgroundColor
addSubview(animatedImageView)
animatedImageView.autoPinEdgesToSuperviewEdges()
addUploadProgressIfNecessary(animatedImageView) { (_) in
}
addUploadProgressIfNecessary(animatedImageView)
loadBlock = { [weak self] in
guard let strongSelf = self else {
return
@ -176,8 +178,7 @@ public class ConversationMediaView: UIView {
stillImageView.backgroundColor = Theme.offBackgroundColor
addSubview(stillImageView)
stillImageView.autoPinEdgesToSuperviewEdges()
addUploadProgressIfNecessary(stillImageView) { (_) in
}
addUploadProgressIfNecessary(stillImageView)
loadBlock = { [weak self] in
guard let strongSelf = self else {
return

Loading…
Cancel
Save