From e62cb4847bb33489b9681354bafd3fce63825fc0 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 25 Mar 2021 13:51:40 -0500 Subject: [PATCH] Only update the timer when the refreshInterval changes --- Mac/AppDelegate.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 7b51714a9..0f5b8085a 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -49,6 +49,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, var refreshTimer: AccountRefreshTimer? var syncTimer: ArticleStatusSyncTimer? + var lastRefreshInterval = AppDefaults.shared.refreshInterval var shuttingDown = false { didSet { @@ -350,7 +351,12 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, @objc func userDefaultsDidChange(_ note: Notification) { updateSortMenuItems() updateGroupByFeedMenuItem() - refreshTimer?.update() + + if lastRefreshInterval != AppDefaults.shared.refreshInterval { + refreshTimer?.update() + lastRefreshInterval = AppDefaults.shared.refreshInterval + } + updateDockBadge() }