Skip to content

Commit

Permalink
Remove unnecessary block
Browse files Browse the repository at this point in the history
Reviewed By: joesus

Differential Revision: D26491377

fbshipit-source-id: accbc58ffdc8d2633b1cdaeaad0cf4b20d0c936c
  • Loading branch information
patters authored and facebook-github-bot committed Feb 18, 2021
1 parent c9da77b commit 757bbec
Showing 1 changed file with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,16 @@ - (BOOL)processError:(NSError *)error request:(FBSDKGraphRequest *)request deleg
if (request.tokenString && [request.tokenString isEqualToString:[FBSDKAccessToken currentAccessToken].tokenString]) {
_recoveryAttempter = error.recoveryAttempter;

// Set up a block to do the typical recovery work so that we can chain it for ios auth special cases.
// the block returns YES if recovery UI is started (meaning we wait for the alertviewdelegate to resume control flow).
BOOL (^standardRecoveryWork)(void) = ^BOOL {
NSArray *recoveryOptionsTitles = error.userInfo[NSLocalizedRecoveryOptionsErrorKey];
if (recoveryOptionsTitles.count > 0 && self->_recoveryAttempter) {
NSString *recoverySuggestion = error.userInfo[NSLocalizedRecoverySuggestionErrorKey];
self->_error = error;
dispatch_async(dispatch_get_main_queue(), ^{
[self displayAlertWithRecoverySuggestion:recoverySuggestion recoveryOptionsTitles:recoveryOptionsTitles];
});
return YES;
}
return NO;
};

return standardRecoveryWork();
// return YES if recovery UI is started (meaning we wait for the alertviewdelegate to resume control flow).
NSArray *recoveryOptionsTitles = error.userInfo[NSLocalizedRecoveryOptionsErrorKey];
if (recoveryOptionsTitles.count > 0 && self->_recoveryAttempter) {
NSString *recoverySuggestion = error.userInfo[NSLocalizedRecoverySuggestionErrorKey];
self->_error = error;
dispatch_async(dispatch_get_main_queue(), ^{
[self displayAlertWithRecoverySuggestion:recoverySuggestion recoveryOptionsTitles:recoveryOptionsTitles];
});
return YES;
}
}
return NO;
case FBSDKGraphRequestErrorOther:
Expand Down

0 comments on commit 757bbec

Please sign in to comment.