From ada98185415355e9d6436d29c6861b0d9afb1ceb Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 30 Jun 2024 18:14:01 -0700 Subject: [PATCH] Create and use shared initializeDownloaders AppDelegate function. --- Mac/AppDelegate.swift | 5 ++--- Shared/AppDelegate+Shared.swift | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 6ca391b06..a85e15235 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -149,10 +149,9 @@ import Sparkle CacheCleaner.purgeIfNecessary() - FaviconDownloader.shared.delegate = self - FeedIconDownloader.shared.delegate = self + initializeDownloaders() } - + func applicationDidFinishLaunching(_ note: Notification) { #if MAC_APP_STORE || TEST diff --git a/Shared/AppDelegate+Shared.swift b/Shared/AppDelegate+Shared.swift index c1cef6125..8a059fb9a 100644 --- a/Shared/AppDelegate+Shared.swift +++ b/Shared/AppDelegate+Shared.swift @@ -20,4 +20,10 @@ extension AppDelegate: FaviconDownloaderDelegate, FeedIconDownloaderDelegate { await HTMLMetadataDownloader.downloadMetadata(for: url) } + + func initializeDownloaders() { + + FaviconDownloader.shared.delegate = self + FeedIconDownloader.shared.delegate = self + } }