Fix scenario where incorrect platform specific icon image could be returned.
This commit is contained in:
parent
715671edad
commit
d0852d8954
|
@ -27,11 +27,10 @@ extension RSImage {
|
|||
}
|
||||
|
||||
extension IconImage {
|
||||
static var appIcon: IconImage? {
|
||||
static var appIcon: IconImage? = {
|
||||
if let image = RSImage.appIconImage {
|
||||
return IconImage(image)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
|
|
@ -67,6 +67,10 @@ public final class WebFeedIconDownloader {
|
|||
return cachedImage
|
||||
}
|
||||
|
||||
if let hpURLString = feed.homePageURL, let hpURL = URL(string: hpURLString), hpURL.host == "nnw.ranchero.com" {
|
||||
return IconImage.appIcon
|
||||
}
|
||||
|
||||
func checkHomePageURL() {
|
||||
guard let homePageURL = feed.homePageURL else {
|
||||
return
|
||||
|
@ -124,11 +128,6 @@ private extension WebFeedIconDownloader {
|
|||
|
||||
func icon(forHomePageURL homePageURL: String, feed: WebFeed, _ imageResultBlock: @escaping (RSImage?) -> Void) {
|
||||
|
||||
if let url = URL(string: homePageURL), url.host == "nnw.ranchero.com" {
|
||||
imageResultBlock(RSImage.appIconImage)
|
||||
return
|
||||
}
|
||||
|
||||
if homePagesWithNoIconURLCache.contains(homePageURL) || homePagesWithUglyIcons.contains(homePageURL) {
|
||||
imageResultBlock(nil)
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue