Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 574acce

Browse files
authored
Merge pull request #130 from wordpress-mobile/fix/invalid-callback-queue
Fix an issue with `downloadImage` failure callback being called on the background thread
2 parents 8b7b951 + dfb2307 commit 574acce

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ _None._
3030
3131
-->
3232

33+
## 1.14.1
34+
35+
### Bug Fixes
36+
37+
- Fix an issue with `downloadImage` failure callback being called on the background thread [#130]
38+
3339
## 1.14.0
3440

3541
### New Features

Sources/WordPressUI/Extensions/UIImageView+Networking.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ public extension UIImageView {
9292

9393
let task = URLSession.shared.dataTask(with: request, completionHandler: { [weak self] data, response, error in
9494
guard let data = data, let image = UIImage(data: data, scale: UIScreen.main.scale) else {
95-
failure?(error)
95+
DispatchQueue.main.async {
96+
failure?(error)
97+
self?.downloadTask = nil
98+
}
9699
return
97100
}
98101

WordPressUI.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressUI'
5-
s.version = '1.14.0'
5+
s.version = '1.14.1'
66

77
s.summary = 'Home of reusable WordPress UI components.'
88
s.description = <<-DESC

0 commit comments

Comments
 (0)