mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 23:58:36 +01:00
Remove background task scheduling when user defaults change.
This commit is contained in:
parent
461468e14f
commit
5ce45c8977
@ -52,7 +52,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||||||
}
|
}
|
||||||
|
|
||||||
override init() {
|
override init() {
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
appDelegate = self
|
appDelegate = self
|
||||||
|
|
||||||
@ -60,17 +59,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||||||
let _ = ArticleViewControllerWebViewProvider.shared
|
let _ = ArticleViewControllerWebViewProvider.shared
|
||||||
AccountManager.shared = AccountManager()
|
AccountManager.shared = AccountManager()
|
||||||
|
|
||||||
registerBackgroundTasks()
|
|
||||||
|
|
||||||
NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil)
|
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(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 {
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
|
|
||||||
AppDefaults.registerDefaults()
|
AppDefaults.registerDefaults()
|
||||||
|
|
||||||
let isFirstRun = AppDefaults.isFirstRun
|
let isFirstRun = AppDefaults.isFirstRun
|
||||||
if isFirstRun {
|
if isFirstRun {
|
||||||
os_log("Is first run.", log: log, type: .info)
|
os_log("Is first run.", log: log, type: .info)
|
||||||
@ -81,6 +76,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||||||
DefaultFeedsImporter.importDefaultFeeds(account: localAccount)
|
DefaultFeedsImporter.importDefaultFeeds(account: localAccount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registerBackgroundTasks()
|
||||||
initializeDownloaders()
|
initializeDownloaders()
|
||||||
initializeHomeScreenQuickActions()
|
initializeHomeScreenQuickActions()
|
||||||
|
|
||||||
@ -122,10 +118,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func userDefaultsDidChange(_ note: Notification) {
|
|
||||||
scheduleBackgroundFeedRefresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
@objc func accountRefreshDidFinish(_ note: Notification) {
|
@objc func accountRefreshDidFinish(_ note: Notification) {
|
||||||
AppDefaults.lastRefresh = Date()
|
AppDefaults.lastRefresh = Date()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user