mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-23 06:02:35 +01:00
Set placeholder only if something goes wrong (IOS-238)
This commit is contained in:
parent
7420563f37
commit
16d6c9e823
@ -45,11 +45,14 @@ extension FLAnimatedImageView {
|
||||
// cancel task
|
||||
cancelTask()
|
||||
|
||||
// set placeholder
|
||||
image = placeholder
|
||||
|
||||
// set image
|
||||
guard let url = url else { return }
|
||||
guard let url else {
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.image = placeholder
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
activeAvatarRequestURL = url
|
||||
let avatarRequest = AF.request(url).publishData()
|
||||
avatarRequestCancellable = avatarRequest
|
||||
@ -78,7 +81,9 @@ extension FLAnimatedImageView {
|
||||
}
|
||||
}
|
||||
case .failure:
|
||||
break
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.image = placeholder
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user