Skip to content

Commit 910407b

Browse files
committed
Fix initialization of Facebook/Twitter Utils blocking the main thread.
1 parent d311b20 commit 910407b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Parse/Internal/User/AuthenticationProviders/Controller/PFUserAuthenticationController.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#import "PFAnonymousUtils.h"
1717
#import "PFAnonymousAuthenticationProvider.h"
1818
#import "PFUserController.h"
19+
#import "PFCurrentUserController.h"
1920
#import "PFAssert.h"
2021

2122
@interface PFUserAuthenticationController () {
@@ -56,9 +57,11 @@ - (void)registerAuthenticationDelegate:(id<PFUserAuthenticationDelegate>)delegat
5657
});
5758

5859
// TODO: (nlutsenko) Decouple this further.
59-
if (![authType isEqualToString:PFAnonymousUserAuthenticationType]) {
60-
[[PFUser currentUser] synchronizeAuthDataWithAuthType:authType];
61-
}
60+
[[[PFUser currentUserController] getCurrentUserAsyncWithOptions:0] continueWithSuccessBlock:^id(BFTask *task) {
61+
PFUser *user = task.result;
62+
[user synchronizeAuthDataWithAuthType:authType];
63+
return nil;
64+
}];
6265
}
6366

6467
- (void)unregisterAuthenticationDelegateForAuthType:(NSString *)authType {

0 commit comments

Comments
 (0)