Download thumbnails (#690)
This commit is contained in:
parent
29cd795718
commit
d102e090ea
|
@ -63,7 +63,13 @@ extension PickServerSection {
|
|||
]
|
||||
)
|
||||
}()
|
||||
|
||||
if let proxiedThumbnail = server.proxiedThumbnail, let thumbnailUrl = URL(string: proxiedThumbnail) {
|
||||
cell.thumbnailImageView.af.setImage(withURL: thumbnailUrl) { _ in
|
||||
OperationQueue.main.addOperation {
|
||||
cell.thumbnailImageView.isHidden = false
|
||||
}
|
||||
}
|
||||
}
|
||||
attribute.isLast
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak cell] isLast in
|
||||
|
|
|
@ -31,6 +31,8 @@ class PickServerCell: UITableViewCell {
|
|||
thumbnail.translatesAutoresizingMaskIntoConstraints = false
|
||||
thumbnail.backgroundColor = Asset.Colors.brand.color
|
||||
thumbnail.layer.cornerRadius = 8
|
||||
thumbnail.contentMode = .scaleAspectFill
|
||||
thumbnail.layer.masksToBounds = true
|
||||
return thumbnail
|
||||
}()
|
||||
|
||||
|
@ -66,7 +68,8 @@ class PickServerCell: UITableViewCell {
|
|||
|
||||
override func prepareForReuse() {
|
||||
super.prepareForReuse()
|
||||
|
||||
thumbnailImageView.isHidden = true
|
||||
thumbnailImageView.image = nil
|
||||
disposeBag.removeAll()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue