Reset skipped updates when updates are user initiated and checked (#1887)

Instead of only when a new update is found. This resets skipped updates if the user initiates a new check even if a new update is not found.
This commit is contained in:
Mayur Pawashe authored and GitHub committed 2021-07-10 08:52:33 -07:00
1 parent 2157f78ffd
commit 29d4b801fc
1 file changed
+13 -4
+13 -4
View File
@@ -139,22 +139,35 @@
[self.coreDriver preflightForUpdatePermissionPreventingInstallerInteraction:preventsInstallerInteraction reply:reply];
}
- (void)_clearSkippedUpdatesIfUserInitiated
{
if (self.userInitiated) {
[SPUSkippedUpdate clearSkippedUpdateForHost:self.host];
}
}
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders inBackground:(BOOL)background
{
self.httpHeaders = httpHeaders;
self.userAgent = userAgent;
[self _clearSkippedUpdatesIfUserInitiated];
[self.coreDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders inBackground:background requiresSilentInstall:NO];
}
- (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock
{
[self _clearSkippedUpdatesIfUserInitiated];
self.resumingInstallingUpdate = YES;
[self.coreDriver resumeInstallingUpdateWithCompletion:completionBlock];
}
- (void)resumeUpdate:(id<SPUResumableUpdate>)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock
{
[self _clearSkippedUpdatesIfUserInitiated];
// Informational downloads shouldn't be presented as updates to be downloaded
// Neither should items that prevent auto updating
if (!resumableUpdate.updateItem.isInformationOnlyUpdate && !resumableUpdate.updateItem.majorUpgrade) {
@@ -172,10 +185,6 @@
- (void)basicDriverDidFindUpdateWithAppcastItem:(SUAppcastItem *)updateItem secondaryAppcastItem:(SUAppcastItem * _Nullable)secondaryUpdateItem
{
if (self.userInitiated) {
[SPUSkippedUpdate clearSkippedUpdateForHost:self.host];
}
id <SPUUpdaterDelegate> updaterDelegate = self.updaterDelegate;
SPUUserUpdateStage stage;