mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Enable refresh if none has happened in 15 minutes when application becomes active
This commit is contained in:
@@ -14,6 +14,7 @@ struct AppDefaults {
|
||||
static let firstRunDate = "firstRunDate"
|
||||
static let timelineSortDirection = "timelineSortDirection"
|
||||
static let refreshInterval = "refreshInterval"
|
||||
static let lastRefresh = "lastRefresh"
|
||||
}
|
||||
|
||||
static let isFirstRun: Bool = {
|
||||
@@ -43,6 +44,15 @@ struct AppDefaults {
|
||||
}
|
||||
}
|
||||
|
||||
static var lastRefresh: Date? {
|
||||
get {
|
||||
return date(for: Key.lastRefresh)
|
||||
}
|
||||
set {
|
||||
setDate(for: Key.lastRefresh, newValue)
|
||||
}
|
||||
}
|
||||
|
||||
static func registerDefaults() {
|
||||
let defaults: [String : Any] = [Key.timelineSortDirection: ComparisonResult.orderedDescending.rawValue, Key.refreshInterval: RefreshInterval.everyHour.rawValue]
|
||||
UserDefaults.standard.register(defaults: defaults)
|
||||
|
||||
Reference in New Issue
Block a user