mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Add fallback to legacy showUpdateNotFoundWithAcknowledgement method
This commit is contained in:
1 parent
c5def52133
commit
13a36cb904
2 files changed
+21
-5
No files matched your search
Vendored
+17
-5
@@ -274,11 +274,23 @@
|
||||
NSError *nonNullError = error;
|
||||
|
||||
if (error.code == SUNoUpdateError) {
|
||||
[self.userDriver showUpdateNotFoundWithError:(NSError * _Nonnull)error acknowledgement:^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
abortUpdate();
|
||||
});
|
||||
}];
|
||||
if ([self.userDriver respondsToSelector:@selector(showUpdateNotFoundWithError:acknowledgement:)]) {
|
||||
[self.userDriver showUpdateNotFoundWithError:(NSError * _Nonnull)error acknowledgement:^{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
abortUpdate();
|
||||
});
|
||||
}];
|
||||
} else if ([self.userDriver respondsToSelector:@selector(showUpdateNotFoundWithAcknowledgement:)]) {
|
||||
// Eventually we should remove this fallback once clients adopt -showUpdateNotFoundWithError:acknowledgement:
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
[self.userDriver showUpdateNotFoundWithAcknowledgement:^{
|
||||
#pragma clang diagnostic pop
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
abortUpdate();
|
||||
});
|
||||
}];
|
||||
}
|
||||
} else if (error.code == SUInstallationCanceledError || error.code == SUInstallationAuthorizeLaterError) {
|
||||
abortUpdate();
|
||||
} else {
|
||||
|
||||
Vendored
+4
@@ -289,6 +289,10 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
|
||||
*/
|
||||
- (void)dismissUpdateInstallation;
|
||||
|
||||
@optional
|
||||
|
||||
- (void)showUpdateNotFoundWithAcknowledgement:(void (^)(void))acknowledgement __deprecated_msg("Implement -showUpdateNotFoundWithError:acknowledgement: instead");
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Reference in new issue
Block a user