Add hidden preference to suppress syncing on launch. Fixes #894

This commit is contained in:
Maurice Parker 2021-06-16 20:20:32 -05:00
parent 72eacb73b6
commit f26e0b8c81
2 changed files with 18 additions and 3 deletions

View File

@ -44,6 +44,7 @@ final class AppDefaults {
static let timelineShowsSeparators = "CorreiaSeparators"
static let showTitleOnMainWindow = "KafasisTitleMode"
static let feedDoubleClickMarkAsRead = "GruberFeedDoubleClickMarkAsRead"
static let suppressSyncOnLaunch = "DevroeSuppressSyncOnLaunch"
#if !MAC_APP_STORE
static let webInspectorEnabled = "WebInspectorEnabled"
@ -203,6 +204,15 @@ final class AppDefaults {
}
}
var suppressSyncOnLaunch: Bool {
get {
return AppDefaults.bool(for: Key.suppressSyncOnLaunch)
}
set {
AppDefaults.setBool(for: Key.suppressSyncOnLaunch, newValue)
}
}
#if !MAC_APP_STORE
var webInspectorEnabled: Bool {
get {

View File

@ -251,9 +251,14 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
refreshTimer!.update()
syncTimer!.update()
#else
DispatchQueue.main.async {
self.refreshTimer!.timedRefresh(nil)
self.syncTimer!.timedRefresh(nil)
if AppDefaults.shared.suppressSyncOnLaunch {
refreshTimer!.update()
syncTimer!.update()
} else {
DispatchQueue.main.async {
self.refreshTimer!.timedRefresh(nil)
self.syncTimer!.timedRefresh(nil)
}
}
#endif