diff options
Diffstat (limited to 'Juick/ViewControllers')
-rw-r--r-- | Juick/ViewControllers/DiscoverViewController.m | 6 | ||||
-rw-r--r-- | Juick/ViewControllers/LoginViewController.m | 6 | ||||
-rw-r--r-- | Juick/ViewControllers/MessagesViewController.m | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Juick/ViewControllers/DiscoverViewController.m b/Juick/ViewControllers/DiscoverViewController.m index edbd152..ea720be 100644 --- a/Juick/ViewControllers/DiscoverViewController.m +++ b/Juick/ViewControllers/DiscoverViewController.m @@ -24,8 +24,8 @@ -(void) viewDidLoad { self.messagesDelegate = self; if ([User isAuthenticated]) { - [[APIClient sharedClient] authenticate:^(BOOL success) { - if (success) { + [[APIClient sharedClient] authenticate:^(User *user, NSError *error) { + if (user) { if ([self.path length] == 0) { self.path = [APIClient feedUrl]; [self.tabBarItem setTitle:@"My feed"]; @@ -34,7 +34,7 @@ [self setShouldScrollToBottomOnRefresh:NO]; [self refreshData]; } else { - [User throwUnableToLogin:self]; + [User throwUnableToLogin:self error:error]; } }]; diff --git a/Juick/ViewControllers/LoginViewController.m b/Juick/ViewControllers/LoginViewController.m index f8cbcc8..de18286 100644 --- a/Juick/ViewControllers/LoginViewController.m +++ b/Juick/ViewControllers/LoginViewController.m @@ -56,8 +56,8 @@ } - (void) doneSignIn { - [[APIClient sharedClient] authenticate:^(BOOL success) { - if (success) { + [[APIClient sharedClient] authenticate:^(User *user, NSError *error) { + if (user) { [[AppDelegate shared] registerForRemoteNotifications]; CATransition* transition = [CATransition animation]; transition.duration = 0.3; @@ -67,7 +67,7 @@ [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; [self.navigationController dismissViewControllerAnimated:NO completion:nil]; } else { - [User throwUnableToLogin:self]; + [User throwUnableToLogin:self error:error]; } }]; } diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index 265df51..9cece2c 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -31,7 +31,7 @@ } [[APIClient sharedClient] pullNextFromPath:self.path params:self.params callback:^(NSArray *next, NSError *err) { if (err) { - [User throwUnableToLogin:self]; + [User throwUnableToLogin:self error:err]; return; } NSArray *newMsgs = next; |