Fix homePageURLsWithNoFaviconURLCache

This commit is contained in:
Nate Weaver 2020-01-30 15:41:00 -06:00
parent 071bd8c57c
commit b088cda5a5

View File

@ -131,20 +131,12 @@ final class FaviconDownloader {
}
findFaviconURLs(with: url) { (faviconURLs) in
var hasIcons = false
if let faviconURLs = faviconURLs {
if let firstIconURL = faviconURLs.first {
hasIcons = true
let _ = self.favicon(with: firstIconURL, homePageURL: url)
self.remainingFaviconURLs[url] = faviconURLs.dropFirst()
}
}
if (!hasIcons) {
self.homePageURLsWithNoFaviconURLCache.insert(url)
self.homePageURLsWithNoFaviconURLCacheDirty = true
}
}
return nil
@ -167,6 +159,8 @@ final class FaviconDownloader {
remainingFaviconURLs[homePageURL] = faviconURLs.dropFirst();
} else {
remainingFaviconURLs[homePageURL] = nil
self.homePageURLsWithNoFaviconURLCache.insert(homePageURL)
self.homePageURLsWithNoFaviconURLCacheDirty = true
}
}
return