Skip to content

Commit

Permalink
Bump FaviconFinder to 4.5.0 (IOS-289) (#1343)
Browse files Browse the repository at this point in the history
Upgrades dependency to fix crash related to it.
  • Loading branch information
kimar authored Sep 11, 2024
2 parents b13a0e0 + b6d326b commit 69187b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion AppVersion.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 2024.8
MARKETING_VERSION = 2024.9
2 changes: 1 addition & 1 deletion MastodonSDK/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let package = Package(
],
dependencies: [
.package(name: "ArkanaKeys", path: "../dependencies/ArkanaKeys"),
.package(url: "https://github.com/will-lumley/FaviconFinder.git", from: "3.2.2"),
.package(url: "https://github.com/will-lumley/FaviconFinder.git", from: "4.5.0"),
.package(url: "https://github.com/MainasuK/UITextView-Placeholder.git", from: "1.4.1"),
.package(url: "https://github.com/Alamofire/Alamofire.git", from: "5.4.0"),
.package(url: "https://github.com/Alamofire/AlamofireImage.git", from: "4.1.0"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@ extension NewsView {
providerFaviconImageView.image = faviconPlaceholder
if let url = URL(string: link.url) {
let token = providerFaviconImageView.tag
FaviconFinder(url: url).downloadFavicon { [weak self] result in
guard let self = self else { return }
switch result {
case .success(let favicon):
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
guard self.providerFaviconImageView.tag == token else { return }
self.providerFaviconImageView.image = favicon.image
}
case .failure:
break
Task {
do {
let favicon = try await FaviconFinder(url: url).downloadFavicon()
guard self.providerFaviconImageView.tag == token else { return }
self.providerFaviconImageView.image = favicon.image
} catch {
// no-op
}
}
}
Expand Down

0 comments on commit 69187b9

Please sign in to comment.