Ensure permission request response is handled on main thread

We were doing this before but I accidentally removed it in a recent commit.
This commit is contained in:
Zorg committed 2021-04-11 14:43:52 -07:00
1 parent 833eb89bb5
commit 9052ea912d
1 file changed
+8 -6
+8 -6
View File
@@ -310,12 +310,14 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
__weak SPUUpdater *weakSelf = self;
[self.userDriver showUpdatePermissionRequest:updatePermissionRequest reply:^(SUUpdatePermissionResponse *response) {
SPUUpdater *strongSelf = weakSelf;
if (strongSelf != nil) {
[strongSelf updatePermissionRequestFinishedWithResponse:response];
// Schedule checks, but make sure we ignore the delayed call from KVO
[strongSelf resetUpdateCycle];
}
dispatch_async(dispatch_get_main_queue(), ^{
SPUUpdater *strongSelf = weakSelf;
if (strongSelf != nil) {
[strongSelf updatePermissionRequestFinishedWithResponse:response];
// Schedule checks, but make sure we ignore the delayed call from KVO
[strongSelf resetUpdateCycle];
}
});
}];
// We start the update checks and register as observer for changes after the prompt finishes