mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix to stop background refresh when interval set to manually.
This commit is contained in:
@@ -92,7 +92,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
|
||||
}
|
||||
}
|
||||
|
||||
UIApplication.shared.setMinimumBackgroundFetchInterval(AppDefaults.refreshInterval.inSeconds())
|
||||
updateBackgroundRefreshInterval()
|
||||
|
||||
return true
|
||||
|
||||
@@ -222,7 +222,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
|
||||
}
|
||||
|
||||
@objc func userDefaultsDidChange(_ note: Notification) {
|
||||
UIApplication.shared.setMinimumBackgroundFetchInterval(AppDefaults.refreshInterval.inSeconds())
|
||||
updateBackgroundRefreshInterval()
|
||||
}
|
||||
|
||||
@objc func accountRefreshDidFinish(_ note: Notification) {
|
||||
@@ -244,6 +244,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
|
||||
|
||||
private extension AppDelegate {
|
||||
|
||||
func updateBackgroundRefreshInterval() {
|
||||
let refreshInterval = AppDefaults.refreshInterval
|
||||
if refreshInterval == .manually {
|
||||
UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplication.backgroundFetchIntervalNever)
|
||||
} else {
|
||||
UIApplication.shared.setMinimumBackgroundFetchInterval(AppDefaults.refreshInterval.inSeconds())
|
||||
}
|
||||
}
|
||||
|
||||
func sendReceivedArticlesUserNotification(newArticleCount: Int) {
|
||||
|
||||
let content = UNMutableNotificationContent()
|
||||
|
||||
Reference in New Issue
Block a user