From 5ce45c8977af737dc0eda5a8d97e39348fda2d29 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 6 Nov 2019 16:53:13 -0600 Subject: [PATCH] Remove background task scheduling when user defaults change. --- iOS/AppDelegate.swift | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 8d2956606..f75dc0880 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -52,7 +52,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } override init() { - super.init() appDelegate = self @@ -60,17 +59,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD let _ = ArticleViewControllerWebViewProvider.shared AccountManager.shared = AccountManager() - registerBackgroundTasks() - NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(accountRefreshDidFinish(_:)), name: .AccountRefreshDidFinish, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil) - } func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - AppDefaults.registerDefaults() + let isFirstRun = AppDefaults.isFirstRun if isFirstRun { os_log("Is first run.", log: log, type: .info) @@ -81,6 +76,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD DefaultFeedsImporter.importDefaultFeeds(account: localAccount) } + registerBackgroundTasks() initializeDownloaders() initializeHomeScreenQuickActions() @@ -122,10 +118,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } } - @objc func userDefaultsDidChange(_ note: Notification) { - scheduleBackgroundFeedRefresh() - } - @objc func accountRefreshDidFinish(_ note: Notification) { AppDefaults.lastRefresh = Date() }