Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Ref #4329: Favorite Widgets crash. #4505

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension BrowserViewController: NSFetchedResultsControllerDelegate {
for (index, fav) in favs.prefix(16).enumerated() {
if let url = fav.url?.asURL {
group.enter()
let fetcher = FaviconFetcher(siteURL: url, kind: .largeIcon)
let fetcher = FaviconFetcher(siteURL: url, kind: .largeIcon, persistentCheckOverride: true)
widgetFaviconFetchers.append(fetcher)
fetcher.load { _, attributes in
favData[index] = .init(url: url, favicon: attributes)
Expand Down
4 changes: 2 additions & 2 deletions Client/Frontend/Browser/Favicons/FaviconFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ class FaviconFetcher {

static let defaultFaviconImage = #imageLiteral(resourceName: "defaultFavicon")

init(siteURL: URL, kind: Kind, domain: Domain? = nil) {
init(siteURL: URL, kind: Kind, domain: Domain? = nil, persistentCheckOverride: Bool? = nil) {
self.url = siteURL
self.kind = kind
self.domain = domain ?? Domain.getOrCreate(
forUrl: siteURL,
persistent: !PrivateBrowsingManager.shared.isPrivateBrowsing
persistent: persistentCheckOverride ?? !PrivateBrowsingManager.shared.isPrivateBrowsing
)
}

Expand Down