Skip to content

Commit 69187b9

Browse files
authored
Bump FaviconFinder to 4.5.0 (IOS-289) (#1343)
Upgrades dependency to fix crash related to it.
2 parents b13a0e0 + b6d326b commit 69187b9

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

AppVersion.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MARKETING_VERSION = 2024.8
1+
MARKETING_VERSION = 2024.9

MastodonSDK/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let package = Package(
3535
],
3636
dependencies: [
3737
.package(name: "ArkanaKeys", path: "../dependencies/ArkanaKeys"),
38-
.package(url: "https://github.com/will-lumley/FaviconFinder.git", from: "3.2.2"),
38+
.package(url: "https://github.com/will-lumley/FaviconFinder.git", from: "4.5.0"),
3939
.package(url: "https://github.com/MainasuK/UITextView-Placeholder.git", from: "1.4.1"),
4040
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.4.0"),
4141
.package(url: "https://github.com/Alamofire/AlamofireImage.git", from: "4.1.0"),

MastodonSDK/Sources/MastodonUI/View/Content/NewsView+Configuration.swift

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@ extension NewsView {
1818
providerFaviconImageView.image = faviconPlaceholder
1919
if let url = URL(string: link.url) {
2020
let token = providerFaviconImageView.tag
21-
FaviconFinder(url: url).downloadFavicon { [weak self] result in
22-
guard let self = self else { return }
23-
switch result {
24-
case .success(let favicon):
25-
DispatchQueue.main.async { [weak self] in
26-
guard let self = self else { return }
27-
guard self.providerFaviconImageView.tag == token else { return }
28-
self.providerFaviconImageView.image = favicon.image
29-
}
30-
case .failure:
31-
break
21+
Task {
22+
do {
23+
let favicon = try await FaviconFinder(url: url).downloadFavicon()
24+
guard self.providerFaviconImageView.tag == token else { return }
25+
self.providerFaviconImageView.image = favicon.image
26+
} catch {
27+
// no-op
3228
}
3329
}
3430
}

0 commit comments

Comments
 (0)