mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
https://github.com/sparkle-project/Sparkle/pull/1135
This commit is contained in:
1 parent
32b0ca2e0f
commit
3c0e02f333
1 file changed
+12
-2
Vendored
+12
-2
@@ -57,6 +57,8 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
@property (nonatomic, copy) void (^preStartedScheduledUpdateBlock)(void);
|
||||
@property (nonatomic, nullable) id<SPUResumableUpdate> resumableUpdate;
|
||||
|
||||
@property (nonatomic, copy) NSDate *updateLastCheckedDate;
|
||||
|
||||
@property (nonatomic) BOOL loggedATSWarning;
|
||||
@property (nonatomic) BOOL loggedDSAWarning;
|
||||
|
||||
@@ -78,6 +80,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
@synthesize startedUpdater = _startedUpdater;
|
||||
@synthesize preStartedScheduledUpdateBlock = _preStartedScheduledUpdateBlock;
|
||||
@synthesize resumableUpdate = _resumableUpdate;
|
||||
@synthesize updateLastCheckedDate = _updateLastCheckedDate;
|
||||
@synthesize loggedATSWarning = _loggedATSWarning;
|
||||
@synthesize loggedDSAWarning = _loggedDSAWarning;
|
||||
|
||||
@@ -324,13 +327,20 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
|
||||
- (NSDate *)lastUpdateCheckDate
|
||||
{
|
||||
return [self.host objectForUserDefaultsKey:SULastCheckTimeKey];
|
||||
if ([self updateLastCheckedDate] == nil)
|
||||
{
|
||||
[self setUpdateLastCheckedDate:[self.host objectForUserDefaultsKey:SULastCheckTimeKey]];
|
||||
}
|
||||
|
||||
return [self updateLastCheckedDate];
|
||||
}
|
||||
|
||||
- (void)updateLastUpdateCheckDate
|
||||
{
|
||||
[self willChangeValueForKey:NSStringFromSelector(@selector((lastUpdateCheckDate)))];
|
||||
[self.host setObject:[NSDate date] forUserDefaultsKey:SULastCheckTimeKey];
|
||||
// We use an intermediate property for last update check date due to https://github.com/sparkle-project/Sparkle/pull/1135
|
||||
[self setUpdateLastCheckedDate:[NSDate date]];
|
||||
[self.host setObject:[self updateLastCheckedDate] forUserDefaultsKey:SULastCheckTimeKey];
|
||||
[self didChangeValueForKey:NSStringFromSelector(@selector((lastUpdateCheckDate)))];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user