Fix scenario where incorrect platform specific icon image could be returned.

This commit is contained in:
Maurice Parker 2020-03-30 10:56:52 -05:00
parent 715671edad
commit d0852d8954
2 changed files with 6 additions and 8 deletions

View File

@ -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
}
}()
}

View File

@ -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