From 71bc1e5d8afa567c89483cbf76c0e0d785e327dd Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Sat, 7 Dec 2019 16:08:57 -0600 Subject: [PATCH] Return the app icon earlier so we never hit the favicon cache --- Shared/Favicons/FaviconDownloader.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Shared/Favicons/FaviconDownloader.swift b/Shared/Favicons/FaviconDownloader.swift index b493e168e..a49ad6dfd 100644 --- a/Shared/Favicons/FaviconDownloader.swift +++ b/Shared/Favicons/FaviconDownloader.swift @@ -108,11 +108,6 @@ final class FaviconDownloader { } func favicon(with faviconURL: String, homePageURL: String?) -> IconImage? { - if let homePageURL = homePageURL, let url = URL(string: homePageURL) { - if url.host == "nnw.ranchero.com" { - return IconImage.appIcon - } - } let downloader = faviconDownloader(withURL: faviconURL, homePageURL: homePageURL) return downloader.iconImage } @@ -120,6 +115,13 @@ final class FaviconDownloader { func favicon(withHomePageURL homePageURL: String) -> IconImage? { let url = homePageURL.rs_normalizedURL() + + if let url = URL(string: homePageURL) { + if url.host == "nnw.ranchero.com" { + return IconImage.appIcon + } + } + if homePageURLsWithNoFaviconURLCache.contains(url) { return nil }